Mercurial > libpostproc.hg
annotate postprocess_template.c @ 98:e565483b1193 libpostproc
typo fixes: tempBlured --> tempBlurred
author | diego |
---|---|
date | Sat, 22 Mar 2008 17:36:31 +0000 |
parents | 2653d9f33b8a |
children | 83d51d1fb580 |
rev | line source |
---|---|
0 | 1 /* |
22
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
2 * Copyright (C) 2001-2002 Michael Niedermayer (michaelni@gmx.at) |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
3 * |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
4 * This file is part of FFmpeg. |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
5 * |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
6 * FFmpeg is free software; you can redistribute it and/or modify |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
7 * it under the terms of the GNU General Public License as published by |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
8 * the Free Software Foundation; either version 2 of the License, or |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
9 * (at your option) any later version. |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
10 * |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
11 * FFmpeg is distributed in the hope that it will be useful, |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
14 * GNU General Public License for more details. |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
15 * |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
16 * You should have received a copy of the GNU General Public License |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
17 * along with FFmpeg; if not, write to the Free Software |
da3bfee1fa67
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
0
diff
changeset
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
55 | 19 */ |
0 | 20 |
21 /** | |
22 * @file postprocess_template.c | |
23 * mmx/mmx2/3dnow postprocess code. | |
24 */ | |
25 | |
91 | 26 #include "x86_cpu.h" |
0 | 27 |
92 | 28 #define ALIGN_MASK "$-8" |
0 | 29 |
30 #undef PAVGB | |
31 #undef PMINUB | |
32 #undef PMAXUB | |
33 | |
34 #ifdef HAVE_MMX2 | |
35 #define REAL_PAVGB(a,b) "pavgb " #a ", " #b " \n\t" | |
36 #elif defined (HAVE_3DNOW) | |
37 #define REAL_PAVGB(a,b) "pavgusb " #a ", " #b " \n\t" | |
38 #endif | |
39 #define PAVGB(a,b) REAL_PAVGB(a,b) | |
40 | |
41 #ifdef HAVE_MMX2 | |
42 #define PMINUB(a,b,t) "pminub " #a ", " #b " \n\t" | |
43 #elif defined (HAVE_MMX) | |
44 #define PMINUB(b,a,t) \ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
45 "movq " #a ", " #t " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
46 "psubusb " #b ", " #t " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
47 "psubb " #t ", " #a " \n\t" |
0 | 48 #endif |
49 | |
50 #ifdef HAVE_MMX2 | |
51 #define PMAXUB(a,b) "pmaxub " #a ", " #b " \n\t" | |
52 #elif defined (HAVE_MMX) | |
53 #define PMAXUB(a,b) \ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
54 "psubusb " #a ", " #b " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
55 "paddb " #a ", " #b " \n\t" |
0 | 56 #endif |
57 | |
48 | 58 //FIXME? |255-0| = 1 (should not be a problem ...) |
0 | 59 #ifdef HAVE_MMX |
60 /** | |
61 * Check if the middle 8x8 Block in the given 8x16 block is flat | |
62 */ | |
63 static inline int RENAME(vertClassify)(uint8_t src[], int stride, PPContext *c){ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
64 int numEq= 0, dcOk; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
65 src+= stride*4; // src points to begin of the 8x8 Block |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
66 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
67 "movq %0, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
68 "movq %1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
69 : : "m" (c->mmxDcOffset[c->nonBQP]), "m" (c->mmxDcThreshold[c->nonBQP]) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
70 ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
71 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
72 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
73 "lea (%2, %3), %%"REG_a" \n\t" |
0 | 74 // 0 1 2 3 4 5 6 7 8 9 |
75 // %1 eax eax+%2 eax+2%2 %1+4%2 ecx ecx+%2 ecx+2%2 %1+8%2 ecx+4%2 | |
76 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
77 "movq (%2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
78 "movq (%%"REG_a"), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
79 "movq %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
80 "movq %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
81 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
82 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
83 "psubb %%mm1, %%mm0 \n\t" // mm0 = differnece |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
84 "paddb %%mm7, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
85 "pcmpgtb %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
86 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
87 "movq (%%"REG_a",%3), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
88 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
89 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
90 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
91 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
92 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
93 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
94 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
95 "movq (%%"REG_a", %3, 2), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
96 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
97 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
98 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
99 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
100 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
101 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
102 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
103 "lea (%%"REG_a", %3, 4), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
104 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
105 "movq (%2, %3, 4), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
106 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
107 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
108 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
109 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
110 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
111 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
112 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
113 "movq (%%"REG_a"), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
114 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
115 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
116 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
117 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
118 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
119 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
120 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
121 "movq (%%"REG_a", %3), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
122 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
123 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
124 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
125 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
126 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
127 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
129 "movq (%%"REG_a", %3, 2), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
130 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
131 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
132 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
133 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
134 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
135 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
136 "psubusb %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
137 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
138 " \n\t" |
0 | 139 #ifdef HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
140 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
141 "psadbw %%mm7, %%mm0 \n\t" |
0 | 142 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
143 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
144 "psrlw $8, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
145 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
146 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
147 "psrlq $16, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
148 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
149 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
150 "psrlq $32, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
151 "paddb %%mm1, %%mm0 \n\t" |
0 | 152 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
153 "movq %4, %%mm7 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
154 "paddusb %%mm7, %%mm7 \n\t" // 2QP ... 2QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
155 "psubusb %%mm7, %%mm4 \n\t" // Diff <= 2QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
156 "packssdw %%mm4, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
157 "movd %%mm0, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
158 "movd %%mm4, %1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
159 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
160 : "=r" (numEq), "=r" (dcOk) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
161 : "r" (src), "r" ((long)stride), "m" (c->pQPb) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
162 : "%"REG_a |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
163 ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
164 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
165 numEq= (-numEq) &0xFF; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
166 if(numEq > c->ppMode.flatnessThreshold){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
167 if(dcOk) return 0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
168 else return 1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
169 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
170 return 2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
171 } |
0 | 172 } |
173 #endif //HAVE_MMX | |
174 | |
175 /** | |
176 * Do a vertical low pass filter on the 8x16 block (only write to the 8x8 block in the middle) | |
177 * using the 9-Tap Filter (1,1,2,2,4,2,2,1,1)/16 | |
178 */ | |
179 #ifndef HAVE_ALTIVEC | |
180 static inline void RENAME(doVertLowPass)(uint8_t *src, int stride, PPContext *c) | |
181 { | |
182 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
183 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
184 asm volatile( //"movv %0 %1 %2\n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
185 "movq %2, %%mm0 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
186 "pxor %%mm4, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
187 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
188 "movq (%0), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
189 "movq (%0, %1), %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
190 "movq %%mm5, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
191 "movq %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
192 "psubusb %%mm6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
193 "psubusb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
194 "por %%mm5, %%mm2 \n\t" // ABS Diff of lines |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
195 "psubusb %%mm0, %%mm2 \n\t" // diff <= QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
196 "pcmpeqb %%mm4, %%mm2 \n\t" // diff <= QP -> FF |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
197 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
198 "pand %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
199 "pandn %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
200 "por %%mm2, %%mm6 \n\t"// First Line to Filter |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
201 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
202 "movq (%0, %1, 8), %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
203 "lea (%0, %1, 4), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
204 "lea (%0, %1, 8), %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
205 "sub %1, %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
206 "add %1, %0 \n\t" // %0 points to line 1 not 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
207 "movq (%0, %1, 8), %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
208 "movq %%mm5, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
209 "movq %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
210 "psubusb %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
211 "psubusb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
212 "por %%mm5, %%mm2 \n\t" // ABS Diff of lines |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
213 "psubusb %%mm0, %%mm2 \n\t" // diff <= QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
214 "pcmpeqb %%mm4, %%mm2 \n\t" // diff <= QP -> FF |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
215 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
216 "pand %%mm2, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
217 "pandn %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
218 "por %%mm2, %%mm7 \n\t" // First Line to Filter |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
219 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
220 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
221 // 1 2 3 4 5 6 7 8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
222 // %0 %0+%1 %0+2%1 eax %0+4%1 eax+2%1 ecx eax+4%1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
223 // 6 4 2 2 1 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
224 // 6 4 4 2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
225 // 6 8 2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
226 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
227 "movq (%0, %1), %%mm0 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
228 "movq %%mm0, %%mm1 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
229 PAVGB(%%mm6, %%mm0) //1 1 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
230 PAVGB(%%mm6, %%mm0) //3 1 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
231 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
232 "movq (%0, %1, 4), %%mm2 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
233 "movq %%mm2, %%mm5 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
234 PAVGB((%%REGa), %%mm2) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
235 PAVGB((%0, %1, 2), %%mm2) // 211 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
236 "movq %%mm2, %%mm3 \n\t" // 211 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
237 "movq (%0), %%mm4 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
238 PAVGB(%%mm4, %%mm3) // 4 211 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
239 PAVGB(%%mm0, %%mm3) //642211 /16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
240 "movq %%mm3, (%0) \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
241 // mm1=2 mm2=3(211) mm4=1 mm5=5 mm6=0 mm7=9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
242 "movq %%mm1, %%mm0 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
243 PAVGB(%%mm6, %%mm0) //1 1 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
244 "movq %%mm4, %%mm3 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
245 PAVGB((%0,%1,2), %%mm3) // 1 1 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
246 PAVGB((%%REGa,%1,2), %%mm5) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
247 PAVGB((%%REGa), %%mm5) // 211 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
248 PAVGB(%%mm5, %%mm3) // 2 2211 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
249 PAVGB(%%mm0, %%mm3) //4242211 /16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
250 "movq %%mm3, (%0,%1) \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
251 // mm1=2 mm2=3(211) mm4=1 mm5=4(211) mm6=0 mm7=9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
252 PAVGB(%%mm4, %%mm6) //11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
253 "movq (%%"REG_c"), %%mm0 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
254 PAVGB((%%REGa, %1, 2), %%mm0) // 11/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
255 "movq %%mm0, %%mm3 \n\t" // 11/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
256 PAVGB(%%mm1, %%mm0) // 2 11/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
257 PAVGB(%%mm6, %%mm0) //222 11/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
258 PAVGB(%%mm2, %%mm0) //22242211/16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
259 "movq (%0, %1, 2), %%mm2 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
260 "movq %%mm0, (%0, %1, 2) \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
261 // mm1=2 mm2=3 mm3=6(11) mm4=1 mm5=4(211) mm6=0(11) mm7=9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
262 "movq (%%"REG_a", %1, 4), %%mm0 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
263 PAVGB((%%REGc), %%mm0) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
264 PAVGB(%%mm0, %%mm6) //11 11 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
265 PAVGB(%%mm1, %%mm4) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
266 PAVGB(%%mm2, %%mm1) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
267 PAVGB(%%mm1, %%mm6) //1122 11 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
268 PAVGB(%%mm5, %%mm6) //112242211 /16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
269 "movq (%%"REG_a"), %%mm5 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
270 "movq %%mm6, (%%"REG_a") \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
271 // mm0=7(11) mm1=2(11) mm2=3 mm3=6(11) mm4=1(11) mm5=4 mm7=9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
272 "movq (%%"REG_a", %1, 4), %%mm6 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
273 PAVGB(%%mm7, %%mm6) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
274 PAVGB(%%mm4, %%mm6) // 11 11 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
275 PAVGB(%%mm3, %%mm6) // 11 2211 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
276 PAVGB(%%mm5, %%mm2) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
277 "movq (%0, %1, 4), %%mm4 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
278 PAVGB(%%mm4, %%mm2) // 112 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
279 PAVGB(%%mm2, %%mm6) // 112242211 /16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
280 "movq %%mm6, (%0, %1, 4) \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
281 // mm0=7(11) mm1=2(11) mm2=3(112) mm3=6(11) mm4=5 mm5=4 mm7=9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
282 PAVGB(%%mm7, %%mm1) // 11 2 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
283 PAVGB(%%mm4, %%mm5) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
284 PAVGB(%%mm5, %%mm0) // 11 11 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
285 "movq (%%"REG_a", %1, 2), %%mm6 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
286 PAVGB(%%mm6, %%mm1) // 11 4 2 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
287 PAVGB(%%mm0, %%mm1) // 11224222 /16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
288 "movq %%mm1, (%%"REG_a", %1, 2) \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
289 // mm2=3(112) mm3=6(11) mm4=5 mm5=4(11) mm6=6 mm7=9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
290 PAVGB((%%REGc), %%mm2) // 112 4 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
291 "movq (%%"REG_a", %1, 4), %%mm0 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
292 PAVGB(%%mm0, %%mm6) // 1 1 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
293 PAVGB(%%mm7, %%mm6) // 1 12 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
294 PAVGB(%%mm2, %%mm6) // 1122424 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
295 "movq %%mm6, (%%"REG_c") \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
296 // mm0=8 mm3=6(11) mm4=5 mm5=4(11) mm7=9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
297 PAVGB(%%mm7, %%mm5) // 11 2 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
298 PAVGB(%%mm7, %%mm5) // 11 6 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
299 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
300 PAVGB(%%mm3, %%mm0) // 112 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
301 PAVGB(%%mm0, %%mm5) // 112246 /16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
302 "movq %%mm5, (%%"REG_a", %1, 4) \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
303 "sub %1, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
304 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
305 : |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
306 : "r" (src), "r" ((long)stride), "m" (c->pQPb) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
307 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
308 ); |
0 | 309 #else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
310 const int l1= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
311 const int l2= stride + l1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
312 const int l3= stride + l2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
313 const int l4= stride + l3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
314 const int l5= stride + l4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
315 const int l6= stride + l5; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
316 const int l7= stride + l6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
317 const int l8= stride + l7; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
318 const int l9= stride + l8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
319 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
320 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
321 for(x=0; x<BLOCK_SIZE; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
322 const int first= FFABS(src[0] - src[l1]) < c->QP ? src[0] : src[l1]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
323 const int last= FFABS(src[l8] - src[l9]) < c->QP ? src[l9] : src[l8]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
324 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
325 int sums[10]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
326 sums[0] = 4*first + src[l1] + src[l2] + src[l3] + 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
327 sums[1] = sums[0] - first + src[l4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
328 sums[2] = sums[1] - first + src[l5]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
329 sums[3] = sums[2] - first + src[l6]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
330 sums[4] = sums[3] - first + src[l7]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
331 sums[5] = sums[4] - src[l1] + src[l8]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
332 sums[6] = sums[5] - src[l2] + last; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
333 sums[7] = sums[6] - src[l3] + last; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
334 sums[8] = sums[7] - src[l4] + last; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
335 sums[9] = sums[8] - src[l5] + last; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
336 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
337 src[l1]= (sums[0] + sums[2] + 2*src[l1])>>4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
338 src[l2]= (sums[1] + sums[3] + 2*src[l2])>>4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
339 src[l3]= (sums[2] + sums[4] + 2*src[l3])>>4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
340 src[l4]= (sums[3] + sums[5] + 2*src[l4])>>4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
341 src[l5]= (sums[4] + sums[6] + 2*src[l5])>>4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
342 src[l6]= (sums[5] + sums[7] + 2*src[l6])>>4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
343 src[l7]= (sums[6] + sums[8] + 2*src[l7])>>4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
344 src[l8]= (sums[7] + sums[9] + 2*src[l8])>>4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
345 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
346 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
347 } |
0 | 348 #endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
349 } | |
350 #endif //HAVE_ALTIVEC | |
351 | |
352 #if 0 | |
353 /** | |
354 * Experimental implementation of the filter (Algorithm 1) described in a paper from Ramkishor & Karandikar | |
355 * values are correctly clipped (MMX2) | |
356 * values are wraparound (C) | |
49 | 357 * Conclusion: It is fast, but introduces ugly horizontal patterns |
358 * if there is a continuous gradient. | |
0 | 359 0 8 16 24 |
360 x = 8 | |
361 x/2 = 4 | |
362 x/8 = 1 | |
363 1 12 12 23 | |
364 */ | |
365 static inline void RENAME(vertRK1Filter)(uint8_t *src, int stride, int QP) | |
366 { | |
367 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
368 src+= stride*3; |
0 | 369 // FIXME rounding |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
370 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
371 "pxor %%mm7, %%mm7 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
372 "movq "MANGLE(b80)", %%mm6 \n\t" // MIN_SIGNED_BYTE |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
373 "leal (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
374 "leal (%%"REG_a", %1, 4), %%"REG_c" \n\t" |
0 | 375 // 0 1 2 3 4 5 6 7 8 9 |
376 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %0+8%1 ecx+4%1 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
377 "movq "MANGLE(pQPb)", %%mm0 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
378 "movq %%mm0, %%mm1 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
379 "paddusb "MANGLE(b02)", %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
380 "psrlw $2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
381 "pand "MANGLE(b3F)", %%mm0 \n\t" // QP/4,..., QP/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
382 "paddusb %%mm1, %%mm0 \n\t" // QP*1.25 ... |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
383 "movq (%0, %1, 4), %%mm2 \n\t" // line 4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
384 "movq (%%"REG_c"), %%mm3 \n\t" // line 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
385 "movq %%mm2, %%mm4 \n\t" // line 4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
386 "pcmpeqb %%mm5, %%mm5 \n\t" // -1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
387 "pxor %%mm2, %%mm5 \n\t" // -line 4 - 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
388 PAVGB(%%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
389 "paddb %%mm6, %%mm5 \n\t" // (l5-l4)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
390 "psubusb %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
391 "psubusb %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
392 "por %%mm3, %%mm4 \n\t" // |l4 - l5| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
393 "psubusb %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
394 "pcmpeqb %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
395 "pand %%mm4, %%mm5 \n\t" // d/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
396 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
397 // "paddb %%mm6, %%mm2 \n\t" // line 4 + 0x80 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
398 "paddb %%mm5, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
399 // "psubb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
400 "movq %%mm2, (%0,%1, 4) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
401 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
402 "movq (%%"REG_c"), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
403 // "paddb %%mm6, %%mm2 \n\t" // line 5 + 0x80 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
404 "psubb %%mm5, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
405 // "psubb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
406 "movq %%mm2, (%%"REG_c") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
407 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
408 "paddb %%mm6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
409 "psrlw $2, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
410 "pand "MANGLE(b3F)", %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
411 "psubb "MANGLE(b20)", %%mm5 \n\t" // (l5-l4)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
412 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
413 "movq (%%"REG_a", %1, 2), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
414 "paddb %%mm6, %%mm2 \n\t" // line 3 + 0x80 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
415 "paddsb %%mm5, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
416 "psubb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
417 "movq %%mm2, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
418 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
419 "movq (%%"REG_c", %1), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
420 "paddb %%mm6, %%mm2 \n\t" // line 6 + 0x80 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
421 "psubsb %%mm5, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
422 "psubb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
423 "movq %%mm2, (%%"REG_c", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
424 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
425 : |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
426 : "r" (src), "r" ((long)stride) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
427 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
428 ); |
0 | 429 #else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
430 const int l1= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
431 const int l2= stride + l1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
432 const int l3= stride + l2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
433 const int l4= stride + l3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
434 const int l5= stride + l4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
435 const int l6= stride + l5; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
436 // const int l7= stride + l6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
437 // const int l8= stride + l7; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
438 // const int l9= stride + l8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
439 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
440 const int QP15= QP + (QP>>2); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
441 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
442 for(x=0; x<BLOCK_SIZE; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
443 const int v = (src[x+l5] - src[x+l4]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
444 if(FFABS(v) < QP15){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
445 src[x+l3] +=v>>3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
446 src[x+l4] +=v>>1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
447 src[x+l5] -=v>>1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
448 src[x+l6] -=v>>3; |
0 | 449 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
450 } |
0 | 451 |
452 #endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
453 } | |
454 #endif //0 | |
455 | |
456 /** | |
457 * Experimental Filter 1 | |
458 * will not damage linear gradients | |
90 | 459 * Flat blocks should look like they were passed through the (1,1,2,2,4,2,2,1,1) 9-Tap filter |
48 | 460 * can only smooth blocks at the expected locations (it cannot smooth them if they did move) |
461 * MMX2 version does correct clipping C version does not | |
0 | 462 */ |
463 static inline void RENAME(vertX1Filter)(uint8_t *src, int stride, PPContext *co) | |
464 { | |
465 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
466 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
467 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
468 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
469 "pxor %%mm7, %%mm7 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
470 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
471 "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t" |
0 | 472 // 0 1 2 3 4 5 6 7 8 9 |
473 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %0+8%1 ecx+4%1 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
474 "movq (%%"REG_a", %1, 2), %%mm0 \n\t" // line 3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
475 "movq (%0, %1, 4), %%mm1 \n\t" // line 4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
476 "movq %%mm1, %%mm2 \n\t" // line 4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
477 "psubusb %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
478 "psubusb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
479 "por %%mm1, %%mm0 \n\t" // |l2 - l3| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
480 "movq (%%"REG_c"), %%mm3 \n\t" // line 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
481 "movq (%%"REG_c", %1), %%mm4 \n\t" // line 6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
482 "movq %%mm3, %%mm5 \n\t" // line 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
483 "psubusb %%mm4, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
484 "psubusb %%mm5, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
485 "por %%mm4, %%mm3 \n\t" // |l5 - l6| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
486 PAVGB(%%mm3, %%mm0) // (|l2 - l3| + |l5 - l6|)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
487 "movq %%mm2, %%mm1 \n\t" // line 4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
488 "psubusb %%mm5, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
489 "movq %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
490 "pcmpeqb %%mm7, %%mm2 \n\t" // (l4 - l5) <= 0 ? -1 : 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
491 "psubusb %%mm1, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
492 "por %%mm5, %%mm4 \n\t" // |l4 - l5| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
493 "psubusb %%mm0, %%mm4 \n\t" //d = MAX(0, |l4-l5| - (|l2-l3| + |l5-l6|)/2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
494 "movq %%mm4, %%mm3 \n\t" // d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
495 "movq %2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
496 "paddusb %%mm0, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
497 "psubusb %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
498 "pcmpeqb %%mm7, %%mm4 \n\t" // d <= QP ? -1 : 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
499 "psubusb "MANGLE(b01)", %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
500 "pand %%mm4, %%mm3 \n\t" // d <= QP ? d : 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
501 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
502 PAVGB(%%mm7, %%mm3) // d/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
503 "movq %%mm3, %%mm1 \n\t" // d/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
504 PAVGB(%%mm7, %%mm3) // d/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
505 PAVGB(%%mm1, %%mm3) // 3*d/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
506 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
507 "movq (%0, %1, 4), %%mm0 \n\t" // line 4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
508 "pxor %%mm2, %%mm0 \n\t" //(l4 - l5) <= 0 ? -l4-1 : l4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
509 "psubusb %%mm3, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
510 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
511 "movq %%mm0, (%0, %1, 4) \n\t" // line 4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
512 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
513 "movq (%%"REG_c"), %%mm0 \n\t" // line 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
514 "pxor %%mm2, %%mm0 \n\t" //(l4 - l5) <= 0 ? -l5-1 : l5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
515 "paddusb %%mm3, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
516 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
517 "movq %%mm0, (%%"REG_c") \n\t" // line 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
518 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
519 PAVGB(%%mm7, %%mm1) // d/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
520 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
521 "movq (%%"REG_a", %1, 2), %%mm0 \n\t" // line 3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
522 "pxor %%mm2, %%mm0 \n\t" //(l4 - l5) <= 0 ? -l4-1 : l4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
523 "psubusb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
524 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
525 "movq %%mm0, (%%"REG_a", %1, 2) \n\t" // line 3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
526 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
527 "movq (%%"REG_c", %1), %%mm0 \n\t" // line 6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
528 "pxor %%mm2, %%mm0 \n\t" //(l4 - l5) <= 0 ? -l5-1 : l5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
529 "paddusb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
530 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
531 "movq %%mm0, (%%"REG_c", %1) \n\t" // line 6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
532 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
533 PAVGB(%%mm7, %%mm1) // d/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
534 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
535 "movq (%%"REG_a", %1), %%mm0 \n\t" // line 2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
536 "pxor %%mm2, %%mm0 \n\t" //(l4 - l5) <= 0 ? -l2-1 : l2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
537 "psubusb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
538 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
539 "movq %%mm0, (%%"REG_a", %1) \n\t" // line 2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
540 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
541 "movq (%%"REG_c", %1, 2), %%mm0 \n\t" // line 7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
542 "pxor %%mm2, %%mm0 \n\t" //(l4 - l5) <= 0 ? -l7-1 : l7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
543 "paddusb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
544 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
545 "movq %%mm0, (%%"REG_c", %1, 2) \n\t" // line 7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
546 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
547 : |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
548 : "r" (src), "r" ((long)stride), "m" (co->pQPb) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
549 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
550 ); |
0 | 551 #else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
552 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
553 const int l1= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
554 const int l2= stride + l1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
555 const int l3= stride + l2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
556 const int l4= stride + l3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
557 const int l5= stride + l4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
558 const int l6= stride + l5; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
559 const int l7= stride + l6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
560 // const int l8= stride + l7; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
561 // const int l9= stride + l8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
562 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
563 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
564 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
565 for(x=0; x<BLOCK_SIZE; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
566 int a= src[l3] - src[l4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
567 int b= src[l4] - src[l5]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
568 int c= src[l5] - src[l6]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
569 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
570 int d= FFABS(b) - ((FFABS(a) + FFABS(c))>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
571 d= FFMAX(d, 0); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
572 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
573 if(d < co->QP*2){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
574 int v = d * FFSIGN(-b); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
575 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
576 src[l2] +=v>>3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
577 src[l3] +=v>>2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
578 src[l4] +=(3*v)>>3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
579 src[l5] -=(3*v)>>3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
580 src[l6] -=v>>2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
581 src[l7] -=v>>3; |
0 | 582 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
583 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
584 } |
0 | 585 #endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
586 } | |
587 | |
588 #ifndef HAVE_ALTIVEC | |
589 static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext *c) | |
590 { | |
591 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
592 /* | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
593 uint8_t tmp[16]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
594 const int l1= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
595 const int l2= stride + l1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
596 const int l3= stride + l2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
597 const int l4= (int)tmp - (int)src - stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
598 const int l5= (int)tmp - (int)src - stride*3 + 8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
599 const int l6= stride*3 + l3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
600 const int l7= stride + l6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
601 const int l8= stride + l7; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
602 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
603 memcpy(tmp, src+stride*7, 8); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
604 memcpy(tmp+8, src+stride*8, 8); |
0 | 605 */ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
606 src+= stride*4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
607 asm volatile( |
0 | 608 |
97 | 609 #if 0 //slightly more accurate and slightly slower |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
610 "pxor %%mm7, %%mm7 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
611 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
612 "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t" |
0 | 613 // 0 1 2 3 4 5 6 7 |
614 // %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 ecx+%1 ecx+2%1 | |
615 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 | |
616 | |
617 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
618 "movq (%0, %1, 2), %%mm0 \n\t" // l2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
619 "movq (%0), %%mm1 \n\t" // l0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
620 "movq %%mm0, %%mm2 \n\t" // l2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
621 PAVGB(%%mm7, %%mm0) // ~l2/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
622 PAVGB(%%mm1, %%mm0) // ~(l2 + 2l0)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
623 PAVGB(%%mm2, %%mm0) // ~(5l2 + 2l0)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
624 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
625 "movq (%%"REG_a"), %%mm1 \n\t" // l1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
626 "movq (%%"REG_a", %1, 2), %%mm3 \n\t" // l3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
627 "movq %%mm1, %%mm4 \n\t" // l1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
628 PAVGB(%%mm7, %%mm1) // ~l1/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
629 PAVGB(%%mm3, %%mm1) // ~(l1 + 2l3)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
630 PAVGB(%%mm4, %%mm1) // ~(5l1 + 2l3)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
631 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
632 "movq %%mm0, %%mm4 \n\t" // ~(5l2 + 2l0)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
633 "psubusb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
634 "psubusb %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
635 "por %%mm0, %%mm1 \n\t" // ~|2l0 - 5l1 + 5l2 - 2l3|/8 |
0 | 636 // mm1= |lenergy|, mm2= l2, mm3= l3, mm7=0 |
637 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
638 "movq (%0, %1, 4), %%mm0 \n\t" // l4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
639 "movq %%mm0, %%mm4 \n\t" // l4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
640 PAVGB(%%mm7, %%mm0) // ~l4/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
641 PAVGB(%%mm2, %%mm0) // ~(l4 + 2l2)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
642 PAVGB(%%mm4, %%mm0) // ~(5l4 + 2l2)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
643 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
644 "movq (%%"REG_c"), %%mm2 \n\t" // l5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
645 "movq %%mm3, %%mm5 \n\t" // l3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
646 PAVGB(%%mm7, %%mm3) // ~l3/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
647 PAVGB(%%mm2, %%mm3) // ~(l3 + 2l5)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
648 PAVGB(%%mm5, %%mm3) // ~(5l3 + 2l5)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
649 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
650 "movq %%mm0, %%mm6 \n\t" // ~(5l4 + 2l2)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
651 "psubusb %%mm3, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
652 "psubusb %%mm6, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
653 "por %%mm0, %%mm3 \n\t" // ~|2l2 - 5l3 + 5l4 - 2l5|/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
654 "pcmpeqb %%mm7, %%mm0 \n\t" // SIGN(2l2 - 5l3 + 5l4 - 2l5) |
0 | 655 // mm0= SIGN(menergy), mm1= |lenergy|, mm2= l5, mm3= |menergy|, mm4=l4, mm5= l3, mm7=0 |
656 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
657 "movq (%%"REG_c", %1), %%mm6 \n\t" // l6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
658 "movq %%mm6, %%mm5 \n\t" // l6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
659 PAVGB(%%mm7, %%mm6) // ~l6/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
660 PAVGB(%%mm4, %%mm6) // ~(l6 + 2l4)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
661 PAVGB(%%mm5, %%mm6) // ~(5l6 + 2l4)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
662 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
663 "movq (%%"REG_c", %1, 2), %%mm5 \n\t" // l7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
664 "movq %%mm2, %%mm4 \n\t" // l5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
665 PAVGB(%%mm7, %%mm2) // ~l5/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
666 PAVGB(%%mm5, %%mm2) // ~(l5 + 2l7)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
667 PAVGB(%%mm4, %%mm2) // ~(5l5 + 2l7)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
668 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
669 "movq %%mm6, %%mm4 \n\t" // ~(5l6 + 2l4)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
670 "psubusb %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
671 "psubusb %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
672 "por %%mm6, %%mm2 \n\t" // ~|2l4 - 5l5 + 5l6 - 2l7|/8 |
0 | 673 // mm0= SIGN(menergy), mm1= |lenergy|/8, mm2= |renergy|/8, mm3= |menergy|/8, mm7=0 |
674 | |
675 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
676 PMINUB(%%mm2, %%mm1, %%mm4) // MIN(|lenergy|,|renergy|)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
677 "movq %2, %%mm4 \n\t" // QP //FIXME QP+1 ? |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
678 "paddusb "MANGLE(b01)", %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
679 "pcmpgtb %%mm3, %%mm4 \n\t" // |menergy|/8 < QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
680 "psubusb %%mm1, %%mm3 \n\t" // d=|menergy|/8-MIN(|lenergy|,|renergy|)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
681 "pand %%mm4, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
682 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
683 "movq %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
684 // "psubusb "MANGLE(b01)", %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
685 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
686 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
687 "paddusb %%mm1, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
688 // "paddusb "MANGLE(b01)", %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
689 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
690 "movq (%%"REG_a", %1, 2), %%mm6 \n\t" //l3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
691 "movq (%0, %1, 4), %%mm5 \n\t" //l4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
692 "movq (%0, %1, 4), %%mm4 \n\t" //l4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
693 "psubusb %%mm6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
694 "psubusb %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
695 "por %%mm6, %%mm5 \n\t" // |l3-l4| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
696 "pcmpeqb %%mm7, %%mm6 \n\t" // SIGN(l3-l4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
697 "pxor %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
698 "pand %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
699 PMINUB(%%mm5, %%mm3, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
700 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
701 "psubusb "MANGLE(b01)", %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
702 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
703 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
704 "movq (%%"REG_a", %1, 2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
705 "movq (%0, %1, 4), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
706 "pxor %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
707 "pxor %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
708 "psubb %%mm3, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
709 "paddb %%mm3, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
710 "pxor %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
711 "pxor %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
712 "movq %%mm0, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
713 "movq %%mm2, (%0, %1, 4) \n\t" |
0 | 714 #endif //0 |
715 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
716 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
717 "pcmpeqb %%mm6, %%mm6 \n\t" // -1 |
0 | 718 // 0 1 2 3 4 5 6 7 |
719 // %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 ecx+%1 ecx+2%1 | |
720 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 | |
721 | |
722 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
723 "movq (%%"REG_a", %1, 2), %%mm1 \n\t" // l3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
724 "movq (%0, %1, 4), %%mm0 \n\t" // l4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
725 "pxor %%mm6, %%mm1 \n\t" // -l3-1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
726 PAVGB(%%mm1, %%mm0) // -q+128 = (l4-l3+256)/2 |
0 | 727 // mm1=-l3-1, mm0=128-q |
728 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
729 "movq (%%"REG_a", %1, 4), %%mm2 \n\t" // l5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
730 "movq (%%"REG_a", %1), %%mm3 \n\t" // l2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
731 "pxor %%mm6, %%mm2 \n\t" // -l5-1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
732 "movq %%mm2, %%mm5 \n\t" // -l5-1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
733 "movq "MANGLE(b80)", %%mm4 \n\t" // 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
734 "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
735 PAVGB(%%mm3, %%mm2) // (l2-l5+256)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
736 PAVGB(%%mm0, %%mm4) // ~(l4-l3)/4 + 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
737 PAVGB(%%mm2, %%mm4) // ~(l2-l5)/4 +(l4-l3)/8 + 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
738 PAVGB(%%mm0, %%mm4) // ~(l2-l5)/8 +5(l4-l3)/16 + 128 |
0 | 739 // mm1=-l3-1, mm0=128-q, mm3=l2, mm4=menergy/16 + 128, mm5= -l5-1 |
740 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
741 "movq (%%"REG_a"), %%mm2 \n\t" // l1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
742 "pxor %%mm6, %%mm2 \n\t" // -l1-1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
743 PAVGB(%%mm3, %%mm2) // (l2-l1+256)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
744 PAVGB((%0), %%mm1) // (l0-l3+256)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
745 "movq "MANGLE(b80)", %%mm3 \n\t" // 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
746 PAVGB(%%mm2, %%mm3) // ~(l2-l1)/4 + 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
747 PAVGB(%%mm1, %%mm3) // ~(l0-l3)/4 +(l2-l1)/8 + 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
748 PAVGB(%%mm2, %%mm3) // ~(l0-l3)/8 +5(l2-l1)/16 + 128 |
0 | 749 // mm0=128-q, mm3=lenergy/16 + 128, mm4= menergy/16 + 128, mm5= -l5-1 |
750 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
751 PAVGB((%%REGc, %1), %%mm5) // (l6-l5+256)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
752 "movq (%%"REG_c", %1, 2), %%mm1 \n\t" // l7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
753 "pxor %%mm6, %%mm1 \n\t" // -l7-1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
754 PAVGB((%0, %1, 4), %%mm1) // (l4-l7+256)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
755 "movq "MANGLE(b80)", %%mm2 \n\t" // 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
756 PAVGB(%%mm5, %%mm2) // ~(l6-l5)/4 + 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
757 PAVGB(%%mm1, %%mm2) // ~(l4-l7)/4 +(l6-l5)/8 + 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
758 PAVGB(%%mm5, %%mm2) // ~(l4-l7)/8 +5(l6-l5)/16 + 128 |
0 | 759 // mm0=128-q, mm2=renergy/16 + 128, mm3=lenergy/16 + 128, mm4= menergy/16 + 128 |
760 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
761 "movq "MANGLE(b00)", %%mm1 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
762 "movq "MANGLE(b00)", %%mm5 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
763 "psubb %%mm2, %%mm1 \n\t" // 128 - renergy/16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
764 "psubb %%mm3, %%mm5 \n\t" // 128 - lenergy/16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
765 PMAXUB(%%mm1, %%mm2) // 128 + |renergy/16| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
766 PMAXUB(%%mm5, %%mm3) // 128 + |lenergy/16| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
767 PMINUB(%%mm2, %%mm3, %%mm1) // 128 + MIN(|lenergy|,|renergy|)/16 |
0 | 768 |
769 // mm0=128-q, mm3=128 + MIN(|lenergy|,|renergy|)/16, mm4= menergy/16 + 128 | |
770 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
771 "movq "MANGLE(b00)", %%mm7 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
772 "movq %2, %%mm2 \n\t" // QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
773 PAVGB(%%mm6, %%mm2) // 128 + QP/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
774 "psubb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
775 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
776 "movq %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
777 "pcmpgtb %%mm7, %%mm1 \n\t" // SIGN(menergy) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
778 "pxor %%mm1, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
779 "psubb %%mm1, %%mm4 \n\t" // 128 + |menergy|/16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
780 "pcmpgtb %%mm4, %%mm2 \n\t" // |menergy|/16 < QP/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
781 "psubusb %%mm3, %%mm4 \n\t" //d=|menergy|/16 - MIN(|lenergy|,|renergy|)/16 |
0 | 782 // mm0=128-q, mm1= SIGN(menergy), mm2= |menergy|/16 < QP/2, mm4= d/16 |
783 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
784 "movq %%mm4, %%mm3 \n\t" // d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
785 "psubusb "MANGLE(b01)", %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
786 PAVGB(%%mm7, %%mm4) // d/32 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
787 PAVGB(%%mm7, %%mm4) // (d + 32)/64 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
788 "paddb %%mm3, %%mm4 \n\t" // 5d/64 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
789 "pand %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
790 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
791 "movq "MANGLE(b80)", %%mm5 \n\t" // 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
792 "psubb %%mm0, %%mm5 \n\t" // q |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
793 "paddsb %%mm6, %%mm5 \n\t" // fix bad rounding |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
794 "pcmpgtb %%mm5, %%mm7 \n\t" // SIGN(q) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
795 "pxor %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
796 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
797 PMINUB(%%mm5, %%mm4, %%mm3) // MIN(|q|, 5d/64) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
798 "pxor %%mm1, %%mm7 \n\t" // SIGN(d*q) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
799 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
800 "pand %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
801 "movq (%%"REG_a", %1, 2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
802 "movq (%0, %1, 4), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
803 "pxor %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
804 "pxor %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
805 "paddb %%mm4, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
806 "psubb %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
807 "pxor %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
808 "pxor %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
809 "movq %%mm0, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
810 "movq %%mm2, (%0, %1, 4) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
811 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
812 : |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
813 : "r" (src), "r" ((long)stride), "m" (c->pQPb) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
814 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
815 ); |
0 | 816 |
817 /* | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
818 { |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
819 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
820 src-= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
821 for(x=0; x<BLOCK_SIZE; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
822 const int middleEnergy= 5*(src[l5] - src[l4]) + 2*(src[l3] - src[l6]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
823 if(FFABS(middleEnergy)< 8*QP){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
824 const int q=(src[l4] - src[l5])/2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
825 const int leftEnergy= 5*(src[l3] - src[l2]) + 2*(src[l1] - src[l4]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
826 const int rightEnergy= 5*(src[l7] - src[l6]) + 2*(src[l5] - src[l8]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
827 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
828 int d= FFABS(middleEnergy) - FFMIN( FFABS(leftEnergy), FFABS(rightEnergy) ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
829 d= FFMAX(d, 0); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
830 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
831 d= (5*d + 32) >> 6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
832 d*= FFSIGN(-middleEnergy); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
833 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
834 if(q>0){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
835 d= d<0 ? 0 : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
836 d= d>q ? q : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
837 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
838 d= d>0 ? 0 : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
839 d= d<q ? q : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
840 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
841 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
842 src[l4]-= d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
843 src[l5]+= d; |
0 | 844 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
845 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
846 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
847 src-=8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
848 for(x=0; x<8; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
849 int y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
850 for(y=4; y<6; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
851 int d= src[x+y*stride] - tmp[x+(y-4)*8]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
852 int ad= FFABS(d); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
853 static int max=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
854 static int sum=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
855 static int num=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
856 static int bias=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
857 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
858 if(max<ad) max=ad; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
859 sum+= ad>3 ? 1 : 0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
860 if(ad>3){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
861 src[0] = src[7] = src[stride*7] = src[(stride+1)*7]=255; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
862 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
863 if(y==4) bias+=d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
864 num++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
865 if(num%1000000 == 0){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
866 av_log(c, AV_LOG_INFO, " %d %d %d %d\n", num, sum, max, bias); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
867 } |
0 | 868 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
869 } |
0 | 870 } |
871 */ | |
872 #elif defined (HAVE_MMX) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
873 src+= stride*4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
874 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
875 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
876 "lea -40(%%"REG_SP"), %%"REG_c" \n\t" // make space for 4 8-byte vars |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
877 "and "ALIGN_MASK", %%"REG_c" \n\t" // align |
0 | 878 // 0 1 2 3 4 5 6 7 |
879 // %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 edx+%1 edx+2%1 | |
880 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 | |
881 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
882 "movq (%0), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
883 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
884 "punpcklbw %%mm7, %%mm0 \n\t" // low part of line 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
885 "punpckhbw %%mm7, %%mm1 \n\t" // high part of line 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
886 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
887 "movq (%0, %1), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
888 "lea (%0, %1, 2), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
889 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
890 "punpcklbw %%mm7, %%mm2 \n\t" // low part of line 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
891 "punpckhbw %%mm7, %%mm3 \n\t" // high part of line 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
892 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
893 "movq (%%"REG_a"), %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
894 "movq %%mm4, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
895 "punpcklbw %%mm7, %%mm4 \n\t" // low part of line 2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
896 "punpckhbw %%mm7, %%mm5 \n\t" // high part of line 2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
897 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
898 "paddw %%mm0, %%mm0 \n\t" // 2L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
899 "paddw %%mm1, %%mm1 \n\t" // 2H0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
900 "psubw %%mm4, %%mm2 \n\t" // L1 - L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
901 "psubw %%mm5, %%mm3 \n\t" // H1 - H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
902 "psubw %%mm2, %%mm0 \n\t" // 2L0 - L1 + L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
903 "psubw %%mm3, %%mm1 \n\t" // 2H0 - H1 + H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
904 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
905 "psllw $2, %%mm2 \n\t" // 4L1 - 4L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
906 "psllw $2, %%mm3 \n\t" // 4H1 - 4H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
907 "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
908 "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
909 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
910 "movq (%%"REG_a", %1), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
911 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
912 "punpcklbw %%mm7, %%mm2 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
913 "punpckhbw %%mm7, %%mm3 \n\t" // H3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
914 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
915 "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 - L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
916 "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 - H3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
917 "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 - 2L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
918 "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 - 2H3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
919 "movq %%mm0, (%%"REG_c") \n\t" // 2L0 - 5L1 + 5L2 - 2L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
920 "movq %%mm1, 8(%%"REG_c") \n\t" // 2H0 - 5H1 + 5H2 - 2H3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
921 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
922 "movq (%%"REG_a", %1, 2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
923 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
924 "punpcklbw %%mm7, %%mm0 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
925 "punpckhbw %%mm7, %%mm1 \n\t" // H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
926 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
927 "psubw %%mm0, %%mm2 \n\t" // L3 - L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
928 "psubw %%mm1, %%mm3 \n\t" // H3 - H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
929 "movq %%mm2, 16(%%"REG_c") \n\t" // L3 - L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
930 "movq %%mm3, 24(%%"REG_c") \n\t" // H3 - H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
931 "paddw %%mm4, %%mm4 \n\t" // 2L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
932 "paddw %%mm5, %%mm5 \n\t" // 2H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
933 "psubw %%mm2, %%mm4 \n\t" // 2L2 - L3 + L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
934 "psubw %%mm3, %%mm5 \n\t" // 2H2 - H3 + H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
935 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
936 "lea (%%"REG_a", %1), %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
937 "psllw $2, %%mm2 \n\t" // 4L3 - 4L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
938 "psllw $2, %%mm3 \n\t" // 4H3 - 4H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
939 "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
940 "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 |
0 | 941 //50 opcodes so far |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
942 "movq (%0, %1, 2), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
943 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
944 "punpcklbw %%mm7, %%mm2 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
945 "punpckhbw %%mm7, %%mm3 \n\t" // H5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
946 "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 - L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
947 "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 - H5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
948 "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 - 2L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
949 "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 - 2H5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
950 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
951 "movq (%%"REG_a", %1, 4), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
952 "punpcklbw %%mm7, %%mm6 \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
953 "psubw %%mm6, %%mm2 \n\t" // L5 - L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
954 "movq (%%"REG_a", %1, 4), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
955 "punpckhbw %%mm7, %%mm6 \n\t" // H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
956 "psubw %%mm6, %%mm3 \n\t" // H5 - H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
957 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
958 "paddw %%mm0, %%mm0 \n\t" // 2L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
959 "paddw %%mm1, %%mm1 \n\t" // 2H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
960 "psubw %%mm2, %%mm0 \n\t" // 2L4 - L5 + L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
961 "psubw %%mm3, %%mm1 \n\t" // 2H4 - H5 + H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
962 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
963 "psllw $2, %%mm2 \n\t" // 4L5 - 4L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
964 "psllw $2, %%mm3 \n\t" // 4H5 - 4H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
965 "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
966 "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
967 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
968 "movq (%0, %1, 4), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
969 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
970 "punpcklbw %%mm7, %%mm2 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
971 "punpckhbw %%mm7, %%mm3 \n\t" // H7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
972 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
973 "paddw %%mm2, %%mm2 \n\t" // 2L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
974 "paddw %%mm3, %%mm3 \n\t" // 2H7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
975 "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6 - 2L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
976 "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6 - 2H7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
977 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
978 "movq (%%"REG_c"), %%mm2 \n\t" // 2L0 - 5L1 + 5L2 - 2L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
979 "movq 8(%%"REG_c"), %%mm3 \n\t" // 2H0 - 5H1 + 5H2 - 2H3 |
0 | 980 |
981 #ifdef HAVE_MMX2 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
982 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
983 "psubw %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
984 "pmaxsw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
985 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
986 "psubw %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
987 "pmaxsw %%mm6, %%mm1 \n\t" // |2H4 - 5H5 + 5H6 - 2H7| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
988 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
989 "psubw %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
990 "pmaxsw %%mm6, %%mm2 \n\t" // |2L0 - 5L1 + 5L2 - 2L3| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
991 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
992 "psubw %%mm3, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
993 "pmaxsw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| |
0 | 994 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
995 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
996 "pcmpgtw %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
997 "pxor %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
998 "psubw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
999 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1000 "pcmpgtw %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1001 "pxor %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1002 "psubw %%mm6, %%mm1 \n\t" // |2H4 - 5H5 + 5H6 - 2H7| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1003 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1004 "pcmpgtw %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1005 "pxor %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1006 "psubw %%mm6, %%mm2 \n\t" // |2L0 - 5L1 + 5L2 - 2L3| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1007 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1008 "pcmpgtw %%mm3, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1009 "pxor %%mm6, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1010 "psubw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| |
0 | 1011 #endif |
1012 | |
1013 #ifdef HAVE_MMX2 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1014 "pminsw %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1015 "pminsw %%mm3, %%mm1 \n\t" |
0 | 1016 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1017 "movq %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1018 "psubusw %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1019 "psubw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1020 "movq %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1021 "psubusw %%mm3, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1022 "psubw %%mm6, %%mm1 \n\t" |
0 | 1023 #endif |
1024 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1025 "movd %2, %%mm2 \n\t" // QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1026 "punpcklbw %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1027 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1028 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1029 "pcmpgtw %%mm4, %%mm6 \n\t" // sign(2L2 - 5L3 + 5L4 - 2L5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1030 "pxor %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1031 "psubw %%mm6, %%mm4 \n\t" // |2L2 - 5L3 + 5L4 - 2L5| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1032 "pcmpgtw %%mm5, %%mm7 \n\t" // sign(2H2 - 5H3 + 5H4 - 2H5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1033 "pxor %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1034 "psubw %%mm7, %%mm5 \n\t" // |2H2 - 5H3 + 5H4 - 2H5| |
0 | 1035 // 100 opcodes |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1036 "psllw $3, %%mm2 \n\t" // 8QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1037 "movq %%mm2, %%mm3 \n\t" // 8QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1038 "pcmpgtw %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1039 "pcmpgtw %%mm5, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1040 "pand %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1041 "pand %%mm3, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1042 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1043 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1044 "psubusw %%mm0, %%mm4 \n\t" // hd |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1045 "psubusw %%mm1, %%mm5 \n\t" // ld |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1046 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1047 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1048 "movq "MANGLE(w05)", %%mm2 \n\t" // 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1049 "pmullw %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1050 "pmullw %%mm2, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1051 "movq "MANGLE(w20)", %%mm2 \n\t" // 32 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1052 "paddw %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1053 "paddw %%mm2, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1054 "psrlw $6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1055 "psrlw $6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1056 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1057 "movq 16(%%"REG_c"), %%mm0 \n\t" // L3 - L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1058 "movq 24(%%"REG_c"), %%mm1 \n\t" // H3 - H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1059 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1060 "pxor %%mm2, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1061 "pxor %%mm3, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1062 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1063 "pcmpgtw %%mm0, %%mm2 \n\t" // sign (L3-L4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1064 "pcmpgtw %%mm1, %%mm3 \n\t" // sign (H3-H4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1065 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1066 "pxor %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1067 "psubw %%mm2, %%mm0 \n\t" // |L3-L4| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1068 "psubw %%mm3, %%mm1 \n\t" // |H3-H4| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1069 "psrlw $1, %%mm0 \n\t" // |L3 - L4|/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1070 "psrlw $1, %%mm1 \n\t" // |H3 - H4|/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1071 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1072 "pxor %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1073 "pxor %%mm7, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1074 "pand %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1075 "pand %%mm3, %%mm5 \n\t" |
0 | 1076 |
1077 #ifdef HAVE_MMX2 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1078 "pminsw %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1079 "pminsw %%mm1, %%mm5 \n\t" |
0 | 1080 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1081 "movq %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1082 "psubusw %%mm0, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1083 "psubw %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1084 "movq %%mm5, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1085 "psubusw %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1086 "psubw %%mm2, %%mm5 \n\t" |
0 | 1087 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1088 "pxor %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1089 "pxor %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1090 "psubw %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1091 "psubw %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1092 "packsswb %%mm5, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1093 "movq (%0), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1094 "paddb %%mm4, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1095 "movq %%mm0, (%0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1096 "movq (%0, %1), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1097 "psubb %%mm4, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1098 "movq %%mm0, (%0, %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1099 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1100 : "+r" (src) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1101 : "r" ((long)stride), "m" (c->pQPb) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1102 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1103 ); |
0 | 1104 #else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1105 const int l1= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1106 const int l2= stride + l1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1107 const int l3= stride + l2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1108 const int l4= stride + l3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1109 const int l5= stride + l4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1110 const int l6= stride + l5; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1111 const int l7= stride + l6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1112 const int l8= stride + l7; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1113 // const int l9= stride + l8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1114 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1115 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1116 for(x=0; x<BLOCK_SIZE; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1117 const int middleEnergy= 5*(src[l5] - src[l4]) + 2*(src[l3] - src[l6]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1118 if(FFABS(middleEnergy) < 8*c->QP){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1119 const int q=(src[l4] - src[l5])/2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1120 const int leftEnergy= 5*(src[l3] - src[l2]) + 2*(src[l1] - src[l4]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1121 const int rightEnergy= 5*(src[l7] - src[l6]) + 2*(src[l5] - src[l8]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1122 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1123 int d= FFABS(middleEnergy) - FFMIN( FFABS(leftEnergy), FFABS(rightEnergy) ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1124 d= FFMAX(d, 0); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1125 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1126 d= (5*d + 32) >> 6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1127 d*= FFSIGN(-middleEnergy); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1129 if(q>0){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1130 d= d<0 ? 0 : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1131 d= d>q ? q : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1132 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1133 d= d>0 ? 0 : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1134 d= d<q ? q : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1135 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1136 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1137 src[l4]-= d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1138 src[l5]+= d; |
0 | 1139 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1140 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1141 } |
0 | 1142 #endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
1143 } | |
1144 #endif //HAVE_ALTIVEC | |
1145 | |
1146 #ifndef HAVE_ALTIVEC | |
1147 static inline void RENAME(dering)(uint8_t src[], int stride, PPContext *c) | |
1148 { | |
1149 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1150 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1151 "pxor %%mm6, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1152 "pcmpeqb %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1153 "movq %2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1154 "punpcklbw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1155 "psrlw $1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1156 "psubw %%mm7, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1157 "packuswb %%mm0, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1158 "movq %%mm0, %3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1159 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1160 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1161 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t" |
0 | 1162 |
1163 // 0 1 2 3 4 5 6 7 8 9 | |
1164 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 | |
1165 | |
1166 #undef FIND_MIN_MAX | |
1167 #ifdef HAVE_MMX2 | |
1168 #define REAL_FIND_MIN_MAX(addr)\ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1169 "movq " #addr ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1170 "pminub %%mm0, %%mm7 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1171 "pmaxub %%mm0, %%mm6 \n\t" |
0 | 1172 #else |
1173 #define REAL_FIND_MIN_MAX(addr)\ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1174 "movq " #addr ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1175 "movq %%mm7, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1176 "psubusb %%mm0, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1177 "paddb %%mm0, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1178 "psubusb %%mm0, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1179 "psubb %%mm1, %%mm7 \n\t" |
0 | 1180 #endif |
1181 #define FIND_MIN_MAX(addr) REAL_FIND_MIN_MAX(addr) | |
1182 | |
1183 FIND_MIN_MAX((%%REGa)) | |
1184 FIND_MIN_MAX((%%REGa, %1)) | |
1185 FIND_MIN_MAX((%%REGa, %1, 2)) | |
1186 FIND_MIN_MAX((%0, %1, 4)) | |
1187 FIND_MIN_MAX((%%REGd)) | |
1188 FIND_MIN_MAX((%%REGd, %1)) | |
1189 FIND_MIN_MAX((%%REGd, %1, 2)) | |
1190 FIND_MIN_MAX((%0, %1, 8)) | |
1191 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1192 "movq %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1193 "psrlq $8, %%mm7 \n\t" |
0 | 1194 #ifdef HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1195 "pminub %%mm4, %%mm7 \n\t" // min of pixels |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1196 "pshufw $0xF9, %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1197 "pminub %%mm4, %%mm7 \n\t" // min of pixels |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1198 "pshufw $0xFE, %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1199 "pminub %%mm4, %%mm7 \n\t" |
0 | 1200 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1201 "movq %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1202 "psubusb %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1203 "psubb %%mm1, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1204 "movq %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1205 "psrlq $16, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1206 "movq %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1207 "psubusb %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1208 "psubb %%mm1, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1209 "movq %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1210 "psrlq $32, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1211 "movq %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1212 "psubusb %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1213 "psubb %%mm1, %%mm7 \n\t" |
0 | 1214 #endif |
1215 | |
1216 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1217 "movq %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1218 "psrlq $8, %%mm6 \n\t" |
0 | 1219 #ifdef HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1220 "pmaxub %%mm4, %%mm6 \n\t" // max of pixels |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1221 "pshufw $0xF9, %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1222 "pmaxub %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1223 "pshufw $0xFE, %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1224 "pmaxub %%mm4, %%mm6 \n\t" |
0 | 1225 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1226 "psubusb %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1227 "paddb %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1228 "movq %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1229 "psrlq $16, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1230 "psubusb %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1231 "paddb %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1232 "movq %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1233 "psrlq $32, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1234 "psubusb %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1235 "paddb %%mm4, %%mm6 \n\t" |
0 | 1236 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1237 "movq %%mm6, %%mm0 \n\t" // max |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1238 "psubb %%mm7, %%mm6 \n\t" // max - min |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1239 "movd %%mm6, %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1240 "cmpb "MANGLE(deringThreshold)", %%cl \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1241 " jb 1f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1242 "lea -24(%%"REG_SP"), %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1243 "and "ALIGN_MASK", %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1244 PAVGB(%%mm0, %%mm7) // a=(max + min)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1245 "punpcklbw %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1246 "punpcklbw %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1247 "punpcklbw %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1248 "movq %%mm7, (%%"REG_c") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1249 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1250 "movq (%0), %%mm0 \n\t" // L10 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1251 "movq %%mm0, %%mm1 \n\t" // L10 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1252 "movq %%mm0, %%mm2 \n\t" // L10 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1253 "psllq $8, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1254 "psrlq $8, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1255 "movd -4(%0), %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1256 "movd 8(%0), %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1257 "psrlq $24, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1258 "psllq $56, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1259 "por %%mm3, %%mm1 \n\t" // L00 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1260 "por %%mm4, %%mm2 \n\t" // L20 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1261 "movq %%mm1, %%mm3 \n\t" // L00 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1262 PAVGB(%%mm2, %%mm1) // (L20 + L00)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1263 PAVGB(%%mm0, %%mm1) // (L20 + L00 + 2L10)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1264 "psubusb %%mm7, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1265 "psubusb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1266 "psubusb %%mm7, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1267 "pcmpeqb "MANGLE(b00)", %%mm0 \n\t" // L10 > a ? 0 : -1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1268 "pcmpeqb "MANGLE(b00)", %%mm2 \n\t" // L20 > a ? 0 : -1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1269 "pcmpeqb "MANGLE(b00)", %%mm3 \n\t" // L00 > a ? 0 : -1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1270 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1271 "paddb %%mm3, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1272 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1273 "movq (%%"REG_a"), %%mm2 \n\t" // L11 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1274 "movq %%mm2, %%mm3 \n\t" // L11 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1275 "movq %%mm2, %%mm4 \n\t" // L11 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1276 "psllq $8, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1277 "psrlq $8, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1278 "movd -4(%%"REG_a"), %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1279 "movd 8(%%"REG_a"), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1280 "psrlq $24, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1281 "psllq $56, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1282 "por %%mm5, %%mm3 \n\t" // L01 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1283 "por %%mm6, %%mm4 \n\t" // L21 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1284 "movq %%mm3, %%mm5 \n\t" // L01 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1285 PAVGB(%%mm4, %%mm3) // (L21 + L01)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1286 PAVGB(%%mm2, %%mm3) // (L21 + L01 + 2L11)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1287 "psubusb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1288 "psubusb %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1289 "psubusb %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1290 "pcmpeqb "MANGLE(b00)", %%mm2 \n\t" // L11 > a ? 0 : -1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1291 "pcmpeqb "MANGLE(b00)", %%mm4 \n\t" // L21 > a ? 0 : -1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1292 "pcmpeqb "MANGLE(b00)", %%mm5 \n\t" // L01 > a ? 0 : -1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1293 "paddb %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1294 "paddb %%mm5, %%mm2 \n\t" |
0 | 1295 // 0, 2, 3, 1 |
1296 #define REAL_DERING_CORE(dst,src,ppsx,psx,sx,pplx,plx,lx,t0,t1) \ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1297 "movq " #src ", " #sx " \n\t" /* src[0] */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1298 "movq " #sx ", " #lx " \n\t" /* src[0] */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1299 "movq " #sx ", " #t0 " \n\t" /* src[0] */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1300 "psllq $8, " #lx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1301 "psrlq $8, " #t0 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1302 "movd -4" #src ", " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1303 "psrlq $24, " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1304 "por " #t1 ", " #lx " \n\t" /* src[-1] */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1305 "movd 8" #src ", " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1306 "psllq $56, " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1307 "por " #t1 ", " #t0 " \n\t" /* src[+1] */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1308 "movq " #lx ", " #t1 " \n\t" /* src[-1] */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1309 PAVGB(t0, lx) /* (src[-1] + src[+1])/2 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1310 PAVGB(sx, lx) /* (src[-1] + 2src[0] + src[+1])/4 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1311 PAVGB(lx, pplx) \ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1312 "movq " #lx ", 8(%%"REG_c") \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1313 "movq (%%"REG_c"), " #lx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1314 "psubusb " #lx ", " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1315 "psubusb " #lx ", " #t0 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1316 "psubusb " #lx ", " #sx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1317 "movq "MANGLE(b00)", " #lx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1318 "pcmpeqb " #lx ", " #t1 " \n\t" /* src[-1] > a ? 0 : -1*/\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1319 "pcmpeqb " #lx ", " #t0 " \n\t" /* src[+1] > a ? 0 : -1*/\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1320 "pcmpeqb " #lx ", " #sx " \n\t" /* src[0] > a ? 0 : -1*/\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1321 "paddb " #t1 ", " #t0 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1322 "paddb " #t0 ", " #sx " \n\t"\ |
0 | 1323 \ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1324 PAVGB(plx, pplx) /* filtered */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1325 "movq " #dst ", " #t0 " \n\t" /* dst */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1326 "movq " #t0 ", " #t1 " \n\t" /* dst */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1327 "psubusb %3, " #t0 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1328 "paddusb %3, " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1329 PMAXUB(t0, pplx)\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1330 PMINUB(t1, pplx, t0)\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1331 "paddb " #sx ", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1332 "paddb " #psx ", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1333 "#paddb "MANGLE(b02)", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1334 "pand "MANGLE(b08)", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1335 "pcmpeqb " #lx ", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1336 "pand " #ppsx ", " #pplx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1337 "pandn " #dst ", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1338 "por " #pplx ", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1339 "movq " #ppsx ", " #dst " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1340 "movq 8(%%"REG_c"), " #lx " \n\t" |
0 | 1341 |
1342 #define DERING_CORE(dst,src,ppsx,psx,sx,pplx,plx,lx,t0,t1) \ | |
1343 REAL_DERING_CORE(dst,src,ppsx,psx,sx,pplx,plx,lx,t0,t1) | |
1344 /* | |
1345 0000000 | |
1346 1111111 | |
1347 | |
1348 1111110 | |
1349 1111101 | |
1350 1111100 | |
1351 1111011 | |
1352 1111010 | |
1353 1111001 | |
1354 | |
1355 1111000 | |
1356 1110111 | |
1357 | |
1358 */ | |
1359 //DERING_CORE(dst ,src ,ppsx ,psx ,sx ,pplx ,plx ,lx ,t0 ,t1) | |
1360 DERING_CORE((%%REGa) ,(%%REGa, %1) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7) | |
1361 DERING_CORE((%%REGa, %1) ,(%%REGa, %1, 2),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7) | |
1362 DERING_CORE((%%REGa, %1, 2),(%0, %1, 4) ,%%mm4,%%mm0,%%mm2,%%mm5,%%mm1,%%mm3,%%mm6,%%mm7) | |
1363 DERING_CORE((%0, %1, 4) ,(%%REGd) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7) | |
1364 DERING_CORE((%%REGd) ,(%%REGd, %1) ,%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7) | |
1365 DERING_CORE((%%REGd, %1) ,(%%REGd, %1, 2),%%mm4,%%mm0,%%mm2,%%mm5,%%mm1,%%mm3,%%mm6,%%mm7) | |
1366 DERING_CORE((%%REGd, %1, 2),(%0, %1, 8) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7) | |
1367 DERING_CORE((%0, %1, 8) ,(%%REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7) | |
1368 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1369 "1: \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1370 : : "r" (src), "r" ((long)stride), "m" (c->pQPb), "m"(c->pQPb2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1371 : "%"REG_a, "%"REG_d, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1372 ); |
0 | 1373 #else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1374 int y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1375 int min=255; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1376 int max=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1377 int avg; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1378 uint8_t *p; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1379 int s[10]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1380 const int QP2= c->QP/2 + 1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1381 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1382 for(y=1; y<9; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1383 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1384 p= src + stride*y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1385 for(x=1; x<9; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1386 p++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1387 if(*p > max) max= *p; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1388 if(*p < min) min= *p; |
0 | 1389 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1390 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1391 avg= (min + max + 1)>>1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1392 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1393 if(max - min <deringThreshold) return; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1394 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1395 for(y=0; y<10; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1396 int t = 0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1397 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1398 if(src[stride*y + 0] > avg) t+= 1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1399 if(src[stride*y + 1] > avg) t+= 2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1400 if(src[stride*y + 2] > avg) t+= 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1401 if(src[stride*y + 3] > avg) t+= 8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1402 if(src[stride*y + 4] > avg) t+= 16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1403 if(src[stride*y + 5] > avg) t+= 32; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1404 if(src[stride*y + 6] > avg) t+= 64; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1405 if(src[stride*y + 7] > avg) t+= 128; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1406 if(src[stride*y + 8] > avg) t+= 256; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1407 if(src[stride*y + 9] > avg) t+= 512; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1408 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1409 t |= (~t)<<16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1410 t &= (t<<1) & (t>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1411 s[y] = t; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1412 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1413 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1414 for(y=1; y<9; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1415 int t = s[y-1] & s[y] & s[y+1]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1416 t|= t>>16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1417 s[y-1]= t; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1418 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1419 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1420 for(y=1; y<9; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1421 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1422 int t = s[y-1]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1423 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1424 p= src + stride*y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1425 for(x=1; x<9; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1426 p++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1427 if(t & (1<<x)){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1428 int f= (*(p-stride-1)) + 2*(*(p-stride)) + (*(p-stride+1)) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1429 +2*(*(p -1)) + 4*(*p ) + 2*(*(p +1)) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1430 +(*(p+stride-1)) + 2*(*(p+stride)) + (*(p+stride+1)); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1431 f= (f + 8)>>4; |
0 | 1432 |
1433 #ifdef DEBUG_DERING_THRESHOLD | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1434 asm volatile("emms\n\t":); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1435 { |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1436 static long long numPixels=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1437 if(x!=1 && x!=8 && y!=1 && y!=8) numPixels++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1438 // if((max-min)<20 || (max-min)*QP<200) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1439 // if((max-min)*QP < 500) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1440 // if(max-min<QP/2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1441 if(max-min < 20){ |
96
404a656698ff
cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents:
95
diff
changeset
|
1442 static int numSkipped=0; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1443 static int errorSum=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1444 static int worstQP=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1445 static int worstRange=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1446 static int worstDiff=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1447 int diff= (f - *p); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1448 int absDiff= FFABS(diff); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1449 int error= diff*diff; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1450 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1451 if(x==1 || x==8 || y==1 || y==8) continue; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1452 |
96
404a656698ff
cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents:
95
diff
changeset
|
1453 numSkipped++; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1454 if(absDiff > worstDiff){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1455 worstDiff= absDiff; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1456 worstQP= QP; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1457 worstRange= max-min; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1458 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1459 errorSum+= error; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1460 |
96
404a656698ff
cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents:
95
diff
changeset
|
1461 if(1024LL*1024LL*1024LL % numSkipped == 0){ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1462 av_log(c, AV_LOG_INFO, "sum:%1.3f, skip:%d, wQP:%d, " |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1463 "wRange:%d, wDiff:%d, relSkip:%1.3f\n", |
96
404a656698ff
cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents:
95
diff
changeset
|
1464 (float)errorSum/numSkipped, numSkipped, worstQP, worstRange, |
404a656698ff
cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents:
95
diff
changeset
|
1465 worstDiff, (float)numSkipped/numPixels); |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1466 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1467 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1468 } |
0 | 1469 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1470 if (*p + QP2 < f) *p= *p + QP2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1471 else if(*p - QP2 > f) *p= *p - QP2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1472 else *p=f; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1473 } |
0 | 1474 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1475 } |
0 | 1476 #ifdef DEBUG_DERING_THRESHOLD |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1477 if(max-min < 20){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1478 for(y=1; y<9; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1479 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1480 int t = 0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1481 p= src + stride*y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1482 for(x=1; x<9; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1483 p++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1484 *p = FFMIN(*p + 20, 255); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1485 } |
0 | 1486 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1487 // src[0] = src[7]=src[stride*7]=src[stride*7 + 7]=255; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1488 } |
0 | 1489 #endif |
1490 #endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
1491 } | |
1492 #endif //HAVE_ALTIVEC | |
1493 | |
1494 /** | |
1495 * Deinterlaces the given block by linearly interpolating every second line. | |
1496 * will be called for every 8x8 block and can read & write from line 4-15 | |
90 | 1497 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too. |
0 | 1498 * lines 4-12 will be read into the deblocking filter and should be deinterlaced |
1499 */ | |
1500 static inline void RENAME(deInterlaceInterpolateLinear)(uint8_t src[], int stride) | |
1501 { | |
1502 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1503 src+= 4*stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1504 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1505 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1506 "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t" |
0 | 1507 // 0 1 2 3 4 5 6 7 8 9 |
1508 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %0+8%1 ecx+4%1 | |
1509 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1510 "movq (%0), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1511 "movq (%%"REG_a", %1), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1512 PAVGB(%%mm1, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1513 "movq %%mm0, (%%"REG_a") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1514 "movq (%0, %1, 4), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1515 PAVGB(%%mm0, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1516 "movq %%mm1, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1517 "movq (%%"REG_c", %1), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1518 PAVGB(%%mm1, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1519 "movq %%mm0, (%%"REG_c") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1520 "movq (%0, %1, 8), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1521 PAVGB(%%mm0, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1522 "movq %%mm1, (%%"REG_c", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1523 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1524 : : "r" (src), "r" ((long)stride) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1525 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1526 ); |
0 | 1527 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1528 int a, b, x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1529 src+= 4*stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1530 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1531 for(x=0; x<2; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1532 a= *(uint32_t*)&src[stride*0]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1533 b= *(uint32_t*)&src[stride*2]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1534 *(uint32_t*)&src[stride*1]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1535 a= *(uint32_t*)&src[stride*4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1536 *(uint32_t*)&src[stride*3]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1537 b= *(uint32_t*)&src[stride*6]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1538 *(uint32_t*)&src[stride*5]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1539 a= *(uint32_t*)&src[stride*8]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1540 *(uint32_t*)&src[stride*7]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1541 src += 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1542 } |
0 | 1543 #endif |
1544 } | |
1545 | |
1546 /** | |
1547 * Deinterlaces the given block by cubic interpolating every second line. | |
1548 * will be called for every 8x8 block and can read & write from line 4-15 | |
90 | 1549 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too. |
0 | 1550 * lines 4-12 will be read into the deblocking filter and should be deinterlaced |
1551 * this filter will read lines 3-15 and write 7-13 | |
1552 */ | |
1553 static inline void RENAME(deInterlaceInterpolateCubic)(uint8_t src[], int stride) | |
1554 { | |
1555 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1556 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1557 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1558 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1559 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1560 "lea (%%"REG_d", %1, 4), %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1561 "add %1, %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1562 "pxor %%mm7, %%mm7 \n\t" |
0 | 1563 // 0 1 2 3 4 5 6 7 8 9 10 |
1564 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx | |
1565 | |
1566 #define REAL_DEINT_CUBIC(a,b,c,d,e)\ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1567 "movq " #a ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1568 "movq " #b ", %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1569 "movq " #d ", %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1570 "movq " #e ", %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1571 PAVGB(%%mm2, %%mm1) /* (b+d) /2 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1572 PAVGB(%%mm3, %%mm0) /* a(a+e) /2 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1573 "movq %%mm0, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1574 "punpcklbw %%mm7, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1575 "punpckhbw %%mm7, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1576 "movq %%mm1, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1577 "punpcklbw %%mm7, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1578 "punpckhbw %%mm7, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1579 "psubw %%mm1, %%mm0 \n\t" /* L(a+e - (b+d))/2 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1580 "psubw %%mm3, %%mm2 \n\t" /* H(a+e - (b+d))/2 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1581 "psraw $3, %%mm0 \n\t" /* L(a+e - (b+d))/16 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1582 "psraw $3, %%mm2 \n\t" /* H(a+e - (b+d))/16 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1583 "psubw %%mm0, %%mm1 \n\t" /* L(9b + 9d - a - e)/16 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1584 "psubw %%mm2, %%mm3 \n\t" /* H(9b + 9d - a - e)/16 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1585 "packuswb %%mm3, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1586 "movq %%mm1, " #c " \n\t" |
0 | 1587 #define DEINT_CUBIC(a,b,c,d,e) REAL_DEINT_CUBIC(a,b,c,d,e) |
1588 | |
1589 DEINT_CUBIC((%0) , (%%REGa, %1), (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd, %1)) | |
1590 DEINT_CUBIC((%%REGa, %1), (%0, %1, 4) , (%%REGd) , (%%REGd, %1), (%0, %1, 8)) | |
1591 DEINT_CUBIC((%0, %1, 4) , (%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8) , (%%REGc)) | |
1592 DEINT_CUBIC((%%REGd, %1), (%0, %1, 8) , (%%REGd, %1, 4), (%%REGc) , (%%REGc, %1, 2)) | |
1593 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1594 : : "r" (src), "r" ((long)stride) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1595 : "%"REG_a, "%"REG_d, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1596 ); |
0 | 1597 #else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1598 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1599 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1600 for(x=0; x<8; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1601 src[stride*3] = CLIP((-src[0] + 9*src[stride*2] + 9*src[stride*4] - src[stride*6])>>4); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1602 src[stride*5] = CLIP((-src[stride*2] + 9*src[stride*4] + 9*src[stride*6] - src[stride*8])>>4); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1603 src[stride*7] = CLIP((-src[stride*4] + 9*src[stride*6] + 9*src[stride*8] - src[stride*10])>>4); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1604 src[stride*9] = CLIP((-src[stride*6] + 9*src[stride*8] + 9*src[stride*10] - src[stride*12])>>4); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1605 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1606 } |
0 | 1607 #endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
1608 } | |
1609 | |
1610 /** | |
1611 * Deinterlaces the given block by filtering every second line with a (-1 4 2 4 -1) filter. | |
1612 * will be called for every 8x8 block and can read & write from line 4-15 | |
90 | 1613 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too. |
0 | 1614 * lines 4-12 will be read into the deblocking filter and should be deinterlaced |
1615 * this filter will read lines 4-13 and write 5-11 | |
1616 */ | |
1617 static inline void RENAME(deInterlaceFF)(uint8_t src[], int stride, uint8_t *tmp) | |
1618 { | |
1619 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1620 src+= stride*4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1621 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1622 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1623 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1624 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1625 "movq (%2), %%mm0 \n\t" |
0 | 1626 // 0 1 2 3 4 5 6 7 8 9 10 |
1627 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx | |
1628 | |
1629 #define REAL_DEINT_FF(a,b,c,d)\ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1630 "movq " #a ", %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1631 "movq " #b ", %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1632 "movq " #c ", %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1633 "movq " #d ", %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1634 PAVGB(%%mm3, %%mm1) \ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1635 PAVGB(%%mm4, %%mm0) \ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1636 "movq %%mm0, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1637 "punpcklbw %%mm7, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1638 "punpckhbw %%mm7, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1639 "movq %%mm1, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1640 "punpcklbw %%mm7, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1641 "punpckhbw %%mm7, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1642 "psllw $2, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1643 "psllw $2, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1644 "psubw %%mm0, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1645 "psubw %%mm3, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1646 "movq %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1647 "movq %%mm2, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1648 "punpcklbw %%mm7, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1649 "punpckhbw %%mm7, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1650 "paddw %%mm2, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1651 "paddw %%mm5, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1652 "psraw $2, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1653 "psraw $2, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1654 "packuswb %%mm4, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1655 "movq %%mm1, " #b " \n\t"\ |
0 | 1656 |
1657 #define DEINT_FF(a,b,c,d) REAL_DEINT_FF(a,b,c,d) | |
1658 | |
1659 DEINT_FF((%0) , (%%REGa) , (%%REGa, %1), (%%REGa, %1, 2)) | |
1660 DEINT_FF((%%REGa, %1), (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd) ) | |
1661 DEINT_FF((%0, %1, 4) , (%%REGd) , (%%REGd, %1), (%%REGd, %1, 2)) | |
1662 DEINT_FF((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4)) | |
1663 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1664 "movq %%mm0, (%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1665 : : "r" (src), "r" ((long)stride), "r"(tmp) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1666 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1667 ); |
0 | 1668 #else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1669 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1670 src+= stride*4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1671 for(x=0; x<8; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1672 int t1= tmp[x]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1673 int t2= src[stride*1]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1674 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1675 src[stride*1]= CLIP((-t1 + 4*src[stride*0] + 2*t2 + 4*src[stride*2] - src[stride*3] + 4)>>3); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1676 t1= src[stride*4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1677 src[stride*3]= CLIP((-t2 + 4*src[stride*2] + 2*t1 + 4*src[stride*4] - src[stride*5] + 4)>>3); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1678 t2= src[stride*6]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1679 src[stride*5]= CLIP((-t1 + 4*src[stride*4] + 2*t2 + 4*src[stride*6] - src[stride*7] + 4)>>3); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1680 t1= src[stride*8]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1681 src[stride*7]= CLIP((-t2 + 4*src[stride*6] + 2*t1 + 4*src[stride*8] - src[stride*9] + 4)>>3); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1682 tmp[x]= t1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1683 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1684 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1685 } |
0 | 1686 #endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
1687 } | |
1688 | |
1689 /** | |
1690 * Deinterlaces the given block by filtering every line with a (-1 2 6 2 -1) filter. | |
1691 * will be called for every 8x8 block and can read & write from line 4-15 | |
90 | 1692 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too. |
0 | 1693 * lines 4-12 will be read into the deblocking filter and should be deinterlaced |
1694 * this filter will read lines 4-13 and write 4-11 | |
1695 */ | |
1696 static inline void RENAME(deInterlaceL5)(uint8_t src[], int stride, uint8_t *tmp, uint8_t *tmp2) | |
1697 { | |
1698 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1699 src+= stride*4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1700 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1701 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1702 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1703 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1704 "movq (%2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1705 "movq (%3), %%mm1 \n\t" |
0 | 1706 // 0 1 2 3 4 5 6 7 8 9 10 |
1707 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx | |
1708 | |
1709 #define REAL_DEINT_L5(t1,t2,a,b,c)\ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1710 "movq " #a ", %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1711 "movq " #b ", %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1712 "movq " #c ", %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1713 PAVGB(t2, %%mm3) \ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1714 PAVGB(t1, %%mm4) \ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1715 "movq %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1716 "movq %%mm2, " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1717 "punpcklbw %%mm7, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1718 "punpckhbw %%mm7, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1719 "movq %%mm2, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1720 "paddw %%mm2, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1721 "paddw %%mm6, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1722 "movq %%mm5, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1723 "paddw %%mm5, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1724 "paddw %%mm6, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1725 "movq %%mm3, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1726 "punpcklbw %%mm7, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1727 "punpckhbw %%mm7, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1728 "paddw %%mm3, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1729 "paddw %%mm6, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1730 "paddw %%mm3, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1731 "paddw %%mm6, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1732 "movq %%mm4, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1733 "punpcklbw %%mm7, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1734 "punpckhbw %%mm7, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1735 "psubw %%mm4, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1736 "psubw %%mm6, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1737 "psraw $2, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1738 "psraw $2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1739 "packuswb %%mm5, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1740 "movq %%mm2, " #a " \n\t"\ |
0 | 1741 |
1742 #define DEINT_L5(t1,t2,a,b,c) REAL_DEINT_L5(t1,t2,a,b,c) | |
1743 | |
1744 DEINT_L5(%%mm0, %%mm1, (%0) , (%%REGa) , (%%REGa, %1) ) | |
1745 DEINT_L5(%%mm1, %%mm0, (%%REGa) , (%%REGa, %1) , (%%REGa, %1, 2)) | |
1746 DEINT_L5(%%mm0, %%mm1, (%%REGa, %1) , (%%REGa, %1, 2), (%0, %1, 4) ) | |
1747 DEINT_L5(%%mm1, %%mm0, (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd) ) | |
1748 DEINT_L5(%%mm0, %%mm1, (%0, %1, 4) , (%%REGd) , (%%REGd, %1) ) | |
1749 DEINT_L5(%%mm1, %%mm0, (%%REGd) , (%%REGd, %1) , (%%REGd, %1, 2)) | |
1750 DEINT_L5(%%mm0, %%mm1, (%%REGd, %1) , (%%REGd, %1, 2), (%0, %1, 8) ) | |
1751 DEINT_L5(%%mm1, %%mm0, (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4)) | |
1752 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1753 "movq %%mm0, (%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1754 "movq %%mm1, (%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1755 : : "r" (src), "r" ((long)stride), "r"(tmp), "r"(tmp2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1756 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1757 ); |
0 | 1758 #else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1759 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1760 src+= stride*4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1761 for(x=0; x<8; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1762 int t1= tmp[x]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1763 int t2= tmp2[x]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1764 int t3= src[0]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1765 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1766 src[stride*0]= CLIP((-(t1 + src[stride*2]) + 2*(t2 + src[stride*1]) + 6*t3 + 4)>>3); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1767 t1= src[stride*1]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1768 src[stride*1]= CLIP((-(t2 + src[stride*3]) + 2*(t3 + src[stride*2]) + 6*t1 + 4)>>3); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1769 t2= src[stride*2]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1770 src[stride*2]= CLIP((-(t3 + src[stride*4]) + 2*(t1 + src[stride*3]) + 6*t2 + 4)>>3); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1771 t3= src[stride*3]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1772 src[stride*3]= CLIP((-(t1 + src[stride*5]) + 2*(t2 + src[stride*4]) + 6*t3 + 4)>>3); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1773 t1= src[stride*4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1774 src[stride*4]= CLIP((-(t2 + src[stride*6]) + 2*(t3 + src[stride*5]) + 6*t1 + 4)>>3); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1775 t2= src[stride*5]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1776 src[stride*5]= CLIP((-(t3 + src[stride*7]) + 2*(t1 + src[stride*6]) + 6*t2 + 4)>>3); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1777 t3= src[stride*6]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1778 src[stride*6]= CLIP((-(t1 + src[stride*8]) + 2*(t2 + src[stride*7]) + 6*t3 + 4)>>3); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1779 t1= src[stride*7]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1780 src[stride*7]= CLIP((-(t2 + src[stride*9]) + 2*(t3 + src[stride*8]) + 6*t1 + 4)>>3); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1781 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1782 tmp[x]= t3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1783 tmp2[x]= t1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1784 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1785 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1786 } |
0 | 1787 #endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
1788 } | |
1789 | |
1790 /** | |
1791 * Deinterlaces the given block by filtering all lines with a (1 2 1) filter. | |
1792 * will be called for every 8x8 block and can read & write from line 4-15 | |
90 | 1793 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too. |
0 | 1794 * lines 4-12 will be read into the deblocking filter and should be deinterlaced |
1795 * this filter will read lines 4-13 and write 4-11 | |
1796 */ | |
1797 static inline void RENAME(deInterlaceBlendLinear)(uint8_t src[], int stride, uint8_t *tmp) | |
1798 { | |
1799 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1800 src+= 4*stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1801 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1802 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1803 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t" |
0 | 1804 // 0 1 2 3 4 5 6 7 8 9 |
1805 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 | |
1806 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1807 "movq (%2), %%mm0 \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1808 "movq (%%"REG_a"), %%mm1 \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1809 PAVGB(%%mm1, %%mm0) // L0+L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1810 "movq (%0), %%mm2 \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1811 PAVGB(%%mm2, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1812 "movq %%mm0, (%0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1813 "movq (%%"REG_a", %1), %%mm0 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1814 PAVGB(%%mm0, %%mm2) // L1+L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1815 PAVGB(%%mm1, %%mm2) // 2L2 + L1 + L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1816 "movq %%mm2, (%%"REG_a") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1817 "movq (%%"REG_a", %1, 2), %%mm2 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1818 PAVGB(%%mm2, %%mm1) // L2+L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1819 PAVGB(%%mm0, %%mm1) // 2L3 + L2 + L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1820 "movq %%mm1, (%%"REG_a", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1821 "movq (%0, %1, 4), %%mm1 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1822 PAVGB(%%mm1, %%mm0) // L3+L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1823 PAVGB(%%mm2, %%mm0) // 2L4 + L3 + L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1824 "movq %%mm0, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1825 "movq (%%"REG_d"), %%mm0 \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1826 PAVGB(%%mm0, %%mm2) // L4+L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1827 PAVGB(%%mm1, %%mm2) // 2L5 + L4 + L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1828 "movq %%mm2, (%0, %1, 4) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1829 "movq (%%"REG_d", %1), %%mm2 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1830 PAVGB(%%mm2, %%mm1) // L5+L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1831 PAVGB(%%mm0, %%mm1) // 2L6 + L5 + L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1832 "movq %%mm1, (%%"REG_d") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1833 "movq (%%"REG_d", %1, 2), %%mm1 \n\t" // L8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1834 PAVGB(%%mm1, %%mm0) // L6+L8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1835 PAVGB(%%mm2, %%mm0) // 2L7 + L6 + L8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1836 "movq %%mm0, (%%"REG_d", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1837 "movq (%0, %1, 8), %%mm0 \n\t" // L9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1838 PAVGB(%%mm0, %%mm2) // L7+L9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1839 PAVGB(%%mm1, %%mm2) // 2L8 + L7 + L9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1840 "movq %%mm2, (%%"REG_d", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1841 "movq %%mm1, (%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1842 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1843 : : "r" (src), "r" ((long)stride), "r" (tmp) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1844 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1845 ); |
0 | 1846 #else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1847 int a, b, c, x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1848 src+= 4*stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1849 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1850 for(x=0; x<2; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1851 a= *(uint32_t*)&tmp[stride*0]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1852 b= *(uint32_t*)&src[stride*0]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1853 c= *(uint32_t*)&src[stride*1]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1854 a= (a&c) + (((a^c)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1855 *(uint32_t*)&src[stride*0]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1856 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1857 a= *(uint32_t*)&src[stride*2]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1858 b= (a&b) + (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1859 *(uint32_t*)&src[stride*1]= (c|b) - (((c^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1860 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1861 b= *(uint32_t*)&src[stride*3]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1862 c= (b&c) + (((b^c)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1863 *(uint32_t*)&src[stride*2]= (c|a) - (((c^a)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1864 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1865 c= *(uint32_t*)&src[stride*4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1866 a= (a&c) + (((a^c)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1867 *(uint32_t*)&src[stride*3]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1868 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1869 a= *(uint32_t*)&src[stride*5]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1870 b= (a&b) + (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1871 *(uint32_t*)&src[stride*4]= (c|b) - (((c^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1872 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1873 b= *(uint32_t*)&src[stride*6]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1874 c= (b&c) + (((b^c)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1875 *(uint32_t*)&src[stride*5]= (c|a) - (((c^a)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1876 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1877 c= *(uint32_t*)&src[stride*7]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1878 a= (a&c) + (((a^c)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1879 *(uint32_t*)&src[stride*6]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1880 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1881 a= *(uint32_t*)&src[stride*8]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1882 b= (a&b) + (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1883 *(uint32_t*)&src[stride*7]= (c|b) - (((c^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1884 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1885 *(uint32_t*)&tmp[stride*0]= c; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1886 src += 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1887 tmp += 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1888 } |
0 | 1889 #endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
1890 } | |
1891 | |
1892 /** | |
1893 * Deinterlaces the given block by applying a median filter to every second line. | |
1894 * will be called for every 8x8 block and can read & write from line 4-15, | |
90 | 1895 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too. |
0 | 1896 * lines 4-12 will be read into the deblocking filter and should be deinterlaced |
1897 */ | |
1898 static inline void RENAME(deInterlaceMedian)(uint8_t src[], int stride) | |
1899 { | |
1900 #ifdef HAVE_MMX | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1901 src+= 4*stride; |
0 | 1902 #ifdef HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1903 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1904 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1905 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t" |
0 | 1906 // 0 1 2 3 4 5 6 7 8 9 |
1907 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 | |
1908 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1909 "movq (%0), %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1910 "movq (%%"REG_a", %1), %%mm2 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1911 "movq (%%"REG_a"), %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1912 "movq %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1913 "pmaxub %%mm1, %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1914 "pminub %%mm3, %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1915 "pmaxub %%mm2, %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1916 "pminub %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1917 "movq %%mm0, (%%"REG_a") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1918 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1919 "movq (%0, %1, 4), %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1920 "movq (%%"REG_a", %1, 2), %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1921 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1922 "pmaxub %%mm1, %%mm2 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1923 "pminub %%mm3, %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1924 "pmaxub %%mm0, %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1925 "pminub %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1926 "movq %%mm2, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1927 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1928 "movq (%%"REG_d"), %%mm2 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1929 "movq (%%"REG_d", %1), %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1930 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1931 "pmaxub %%mm0, %%mm2 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1932 "pminub %%mm3, %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1933 "pmaxub %%mm1, %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1934 "pminub %%mm0, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1935 "movq %%mm2, (%%"REG_d") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1936 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1937 "movq (%%"REG_d", %1, 2), %%mm2 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1938 "movq (%0, %1, 8), %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1939 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1940 "pmaxub %%mm0, %%mm2 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1941 "pminub %%mm3, %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1942 "pmaxub %%mm1, %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1943 "pminub %%mm0, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1944 "movq %%mm2, (%%"REG_d", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1945 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1946 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1947 : : "r" (src), "r" ((long)stride) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1948 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1949 ); |
0 | 1950 |
1951 #else // MMX without MMX2 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1952 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1953 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1954 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t" |
0 | 1955 // 0 1 2 3 4 5 6 7 8 9 |
1956 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1957 "pxor %%mm7, %%mm7 \n\t" |
0 | 1958 |
1959 #define REAL_MEDIAN(a,b,c)\ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1960 "movq " #a ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1961 "movq " #b ", %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1962 "movq " #c ", %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1963 "movq %%mm0, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1964 "movq %%mm1, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1965 "movq %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1966 "psubusb %%mm1, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1967 "psubusb %%mm2, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1968 "psubusb %%mm0, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1969 "pcmpeqb %%mm7, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1970 "pcmpeqb %%mm7, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1971 "pcmpeqb %%mm7, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1972 "movq %%mm3, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1973 "pxor %%mm4, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1974 "pxor %%mm5, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1975 "pxor %%mm6, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1976 "por %%mm3, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1977 "por %%mm4, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1978 "por %%mm5, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1979 "pand %%mm2, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1980 "pand %%mm1, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1981 "movq %%mm0, " #b " \n\t" |
0 | 1982 #define MEDIAN(a,b,c) REAL_MEDIAN(a,b,c) |
1983 | |
1984 MEDIAN((%0) , (%%REGa) , (%%REGa, %1)) | |
1985 MEDIAN((%%REGa, %1), (%%REGa, %1, 2), (%0, %1, 4)) | |
1986 MEDIAN((%0, %1, 4) , (%%REGd) , (%%REGd, %1)) | |
1987 MEDIAN((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8)) | |
1988 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1989 : : "r" (src), "r" ((long)stride) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1990 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1991 ); |
0 | 1992 #endif //HAVE_MMX2 |
1993 #else //HAVE_MMX | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1994 int x, y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1995 src+= 4*stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1996 // FIXME - there should be a way to do a few columns in parallel like w/mmx |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1997 for(x=0; x<8; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1998 uint8_t *colsrc = src; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1999 for (y=0; y<4; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2000 int a, b, c, d, e, f; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2001 a = colsrc[0 ]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2002 b = colsrc[stride ]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2003 c = colsrc[stride*2]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2004 d = (a-b)>>31; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2005 e = (b-c)>>31; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2006 f = (c-a)>>31; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2007 colsrc[stride ] = (a|(d^f)) & (b|(d^e)) & (c|(e^f)); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2008 colsrc += stride*2; |
0 | 2009 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2010 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2011 } |
0 | 2012 #endif //HAVE_MMX |
2013 } | |
2014 | |
2015 #ifdef HAVE_MMX | |
2016 /** | |
2017 * transposes and shift the given 8x8 Block into dst1 and dst2 | |
2018 */ | |
2019 static inline void RENAME(transpose1)(uint8_t *dst1, uint8_t *dst2, uint8_t *src, int srcStride) | |
2020 { | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2021 asm( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2022 "lea (%0, %1), %%"REG_a" \n\t" |
0 | 2023 // 0 1 2 3 4 5 6 7 8 9 |
2024 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2025 "movq (%0), %%mm0 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2026 "movq (%%"REG_a"), %%mm1 \n\t" // abcdefgh |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2027 "movq %%mm0, %%mm2 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2028 "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2029 "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2030 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2031 "movq (%%"REG_a", %1), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2032 "movq (%%"REG_a", %1, 2), %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2033 "movq %%mm1, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2034 "punpcklbw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2035 "punpckhbw %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2036 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2037 "movq %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2038 "punpcklwd %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2039 "punpckhwd %%mm1, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2040 "movq %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2041 "punpcklwd %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2042 "punpckhwd %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2043 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2044 "movd %%mm0, 128(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2045 "psrlq $32, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2046 "movd %%mm0, 144(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2047 "movd %%mm3, 160(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2048 "psrlq $32, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2049 "movd %%mm3, 176(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2050 "movd %%mm3, 48(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2051 "movd %%mm2, 192(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2052 "movd %%mm2, 64(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2053 "psrlq $32, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2054 "movd %%mm2, 80(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2055 "movd %%mm1, 96(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2056 "psrlq $32, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2057 "movd %%mm1, 112(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2058 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2059 "lea (%%"REG_a", %1, 4), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2060 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2061 "movq (%0, %1, 4), %%mm0 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2062 "movq (%%"REG_a"), %%mm1 \n\t" // abcdefgh |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2063 "movq %%mm0, %%mm2 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2064 "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2065 "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2066 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2067 "movq (%%"REG_a", %1), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2068 "movq (%%"REG_a", %1, 2), %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2069 "movq %%mm1, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2070 "punpcklbw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2071 "punpckhbw %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2072 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2073 "movq %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2074 "punpcklwd %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2075 "punpckhwd %%mm1, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2076 "movq %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2077 "punpcklwd %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2078 "punpckhwd %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2079 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2080 "movd %%mm0, 132(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2081 "psrlq $32, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2082 "movd %%mm0, 148(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2083 "movd %%mm3, 164(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2084 "psrlq $32, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2085 "movd %%mm3, 180(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2086 "movd %%mm3, 52(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2087 "movd %%mm2, 196(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2088 "movd %%mm2, 68(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2089 "psrlq $32, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2090 "movd %%mm2, 84(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2091 "movd %%mm1, 100(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2092 "psrlq $32, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2093 "movd %%mm1, 116(%3) \n\t" |
0 | 2094 |
2095 | |
2096 :: "r" (src), "r" ((long)srcStride), "r" (dst1), "r" (dst2) | |
2097 : "%"REG_a | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2098 ); |
0 | 2099 } |
2100 | |
2101 /** | |
2102 * transposes the given 8x8 block | |
2103 */ | |
2104 static inline void RENAME(transpose2)(uint8_t *dst, int dstStride, uint8_t *src) | |
2105 { | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2106 asm( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2107 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2108 "lea (%%"REG_a",%1,4), %%"REG_d" \n\t" |
0 | 2109 // 0 1 2 3 4 5 6 7 8 9 |
2110 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2111 "movq (%2), %%mm0 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2112 "movq 16(%2), %%mm1 \n\t" // abcdefgh |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2113 "movq %%mm0, %%mm2 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2114 "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2115 "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2116 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2117 "movq 32(%2), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2118 "movq 48(%2), %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2119 "movq %%mm1, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2120 "punpcklbw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2121 "punpckhbw %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2122 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2123 "movq %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2124 "punpcklwd %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2125 "punpckhwd %%mm1, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2126 "movq %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2127 "punpcklwd %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2128 "punpckhwd %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2129 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2130 "movd %%mm0, (%0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2131 "psrlq $32, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2132 "movd %%mm0, (%%"REG_a") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2133 "movd %%mm3, (%%"REG_a", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2134 "psrlq $32, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2135 "movd %%mm3, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2136 "movd %%mm2, (%0, %1, 4) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2137 "psrlq $32, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2138 "movd %%mm2, (%%"REG_d") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2139 "movd %%mm1, (%%"REG_d", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2140 "psrlq $32, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2141 "movd %%mm1, (%%"REG_d", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2142 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2143 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2144 "movq 64(%2), %%mm0 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2145 "movq 80(%2), %%mm1 \n\t" // abcdefgh |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2146 "movq %%mm0, %%mm2 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2147 "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2148 "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2149 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2150 "movq 96(%2), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2151 "movq 112(%2), %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2152 "movq %%mm1, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2153 "punpcklbw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2154 "punpckhbw %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2155 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2156 "movq %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2157 "punpcklwd %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2158 "punpckhwd %%mm1, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2159 "movq %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2160 "punpcklwd %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2161 "punpckhwd %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2162 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2163 "movd %%mm0, 4(%0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2164 "psrlq $32, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2165 "movd %%mm0, 4(%%"REG_a") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2166 "movd %%mm3, 4(%%"REG_a", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2167 "psrlq $32, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2168 "movd %%mm3, 4(%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2169 "movd %%mm2, 4(%0, %1, 4) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2170 "psrlq $32, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2171 "movd %%mm2, 4(%%"REG_d") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2172 "movd %%mm1, 4(%%"REG_d", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2173 "psrlq $32, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2174 "movd %%mm1, 4(%%"REG_d", %1, 2) \n\t" |
0 | 2175 |
2176 :: "r" (dst), "r" ((long)dstStride), "r" (src) | |
2177 : "%"REG_a, "%"REG_d | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2178 ); |
0 | 2179 } |
2180 #endif //HAVE_MMX | |
2181 //static long test=0; | |
2182 | |
2183 #ifndef HAVE_ALTIVEC | |
2184 static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride, | |
98 | 2185 uint8_t *tempBlurred, uint32_t *tempBlurredPast, int *maxNoise) |
0 | 2186 { |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2187 // to save a register (FIXME do this outside of the loops) |
98 | 2188 tempBlurredPast[127]= maxNoise[0]; |
2189 tempBlurredPast[128]= maxNoise[1]; | |
2190 tempBlurredPast[129]= maxNoise[2]; | |
0 | 2191 |
2192 #define FAST_L2_DIFF | |
2193 //#define L1_DIFF //u should change the thresholds too if u try that one | |
2194 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2195 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2196 "lea (%2, %2, 2), %%"REG_a" \n\t" // 3*stride |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2197 "lea (%2, %2, 4), %%"REG_d" \n\t" // 5*stride |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2198 "lea (%%"REG_d", %2, 2), %%"REG_c" \n\t" // 7*stride |
0 | 2199 // 0 1 2 3 4 5 6 7 8 9 |
2200 // %x %x+%2 %x+2%2 %x+eax %x+4%2 %x+edx %x+2eax %x+ecx %x+8%2 | |
2201 //FIXME reorder? | |
2202 #ifdef L1_DIFF //needs mmx2 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2203 "movq (%0), %%mm0 \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2204 "psadbw (%1), %%mm0 \n\t" // |L0-R0| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2205 "movq (%0, %2), %%mm1 \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2206 "psadbw (%1, %2), %%mm1 \n\t" // |L1-R1| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2207 "movq (%0, %2, 2), %%mm2 \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2208 "psadbw (%1, %2, 2), %%mm2 \n\t" // |L2-R2| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2209 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2210 "psadbw (%1, %%"REG_a"), %%mm3 \n\t" // |L3-R3| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2211 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2212 "movq (%0, %2, 4), %%mm4 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2213 "paddw %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2214 "psadbw (%1, %2, 4), %%mm4 \n\t" // |L4-R4| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2215 "movq (%0, %%"REG_d"), %%mm5 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2216 "paddw %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2217 "psadbw (%1, %%"REG_d"), %%mm5 \n\t" // |L5-R5| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2218 "movq (%0, %%"REG_a", 2), %%mm6 \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2219 "paddw %%mm3, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2220 "psadbw (%1, %%"REG_a", 2), %%mm6 \n\t" // |L6-R6| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2221 "movq (%0, %%"REG_c"), %%mm7 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2222 "paddw %%mm4, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2223 "psadbw (%1, %%"REG_c"), %%mm7 \n\t" // |L7-R7| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2224 "paddw %%mm5, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2225 "paddw %%mm7, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2226 "paddw %%mm6, %%mm0 \n\t" |
0 | 2227 #else //L1_DIFF |
2228 #if defined (FAST_L2_DIFF) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2229 "pcmpeqb %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2230 "movq "MANGLE(b80)", %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2231 "pxor %%mm0, %%mm0 \n\t" |
0 | 2232 #define REAL_L2_DIFF_CORE(a, b)\ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2233 "movq " #a ", %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2234 "movq " #b ", %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2235 "pxor %%mm7, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2236 PAVGB(%%mm2, %%mm5)\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2237 "paddb %%mm6, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2238 "movq %%mm5, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2239 "psllw $8, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2240 "pmaddwd %%mm5, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2241 "pmaddwd %%mm2, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2242 "paddd %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2243 "psrld $14, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2244 "paddd %%mm5, %%mm0 \n\t" |
0 | 2245 |
2246 #else //defined (FAST_L2_DIFF) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2247 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2248 "pxor %%mm0, %%mm0 \n\t" |
0 | 2249 #define REAL_L2_DIFF_CORE(a, b)\ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2250 "movq " #a ", %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2251 "movq " #b ", %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2252 "movq %%mm5, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2253 "movq %%mm2, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2254 "punpcklbw %%mm7, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2255 "punpckhbw %%mm7, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2256 "punpcklbw %%mm7, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2257 "punpckhbw %%mm7, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2258 "psubw %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2259 "psubw %%mm3, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2260 "pmaddwd %%mm5, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2261 "pmaddwd %%mm1, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2262 "paddd %%mm1, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2263 "paddd %%mm5, %%mm0 \n\t" |
0 | 2264 |
2265 #endif //defined (FAST_L2_DIFF) | |
2266 | |
2267 #define L2_DIFF_CORE(a, b) REAL_L2_DIFF_CORE(a, b) | |
2268 | |
2269 L2_DIFF_CORE((%0) , (%1)) | |
2270 L2_DIFF_CORE((%0, %2) , (%1, %2)) | |
2271 L2_DIFF_CORE((%0, %2, 2) , (%1, %2, 2)) | |
2272 L2_DIFF_CORE((%0, %%REGa) , (%1, %%REGa)) | |
2273 L2_DIFF_CORE((%0, %2, 4) , (%1, %2, 4)) | |
2274 L2_DIFF_CORE((%0, %%REGd) , (%1, %%REGd)) | |
2275 L2_DIFF_CORE((%0, %%REGa,2), (%1, %%REGa,2)) | |
2276 L2_DIFF_CORE((%0, %%REGc) , (%1, %%REGc)) | |
2277 | |
2278 #endif //L1_DIFF | |
2279 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2280 "movq %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2281 "psrlq $32, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2282 "paddd %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2283 "movd %%mm4, %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2284 "shll $2, %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2285 "mov %3, %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2286 "addl -4(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2287 "addl 4(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2288 "addl -1024(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2289 "addl $4, %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2290 "addl 1024(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2291 "shrl $3, %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2292 "movl %%ecx, (%%"REG_d") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2293 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2294 // "mov %3, %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2295 // "mov %%"REG_c", test \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2296 // "jmp 4f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2297 "cmpl 512(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2298 " jb 2f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2299 "cmpl 516(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2300 " jb 1f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2301 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2302 "lea (%%"REG_a", %2, 2), %%"REG_d" \n\t" // 5*stride |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2303 "lea (%%"REG_d", %2, 2), %%"REG_c" \n\t" // 7*stride |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2304 "movq (%0), %%mm0 \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2305 "movq (%0, %2), %%mm1 \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2306 "movq (%0, %2, 2), %%mm2 \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2307 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2308 "movq (%0, %2, 4), %%mm4 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2309 "movq (%0, %%"REG_d"), %%mm5 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2310 "movq (%0, %%"REG_a", 2), %%mm6 \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2311 "movq (%0, %%"REG_c"), %%mm7 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2312 "movq %%mm0, (%1) \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2313 "movq %%mm1, (%1, %2) \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2314 "movq %%mm2, (%1, %2, 2) \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2315 "movq %%mm3, (%1, %%"REG_a") \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2316 "movq %%mm4, (%1, %2, 4) \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2317 "movq %%mm5, (%1, %%"REG_d") \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2318 "movq %%mm6, (%1, %%"REG_a", 2) \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2319 "movq %%mm7, (%1, %%"REG_c") \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2320 "jmp 4f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2321 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2322 "1: \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2323 "lea (%%"REG_a", %2, 2), %%"REG_d" \n\t" // 5*stride |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2324 "lea (%%"REG_d", %2, 2), %%"REG_c" \n\t" // 7*stride |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2325 "movq (%0), %%mm0 \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2326 PAVGB((%1), %%mm0) // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2327 "movq (%0, %2), %%mm1 \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2328 PAVGB((%1, %2), %%mm1) // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2329 "movq (%0, %2, 2), %%mm2 \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2330 PAVGB((%1, %2, 2), %%mm2) // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2331 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2332 PAVGB((%1, %%REGa), %%mm3) // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2333 "movq (%0, %2, 4), %%mm4 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2334 PAVGB((%1, %2, 4), %%mm4) // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2335 "movq (%0, %%"REG_d"), %%mm5 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2336 PAVGB((%1, %%REGd), %%mm5) // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2337 "movq (%0, %%"REG_a", 2), %%mm6 \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2338 PAVGB((%1, %%REGa, 2), %%mm6) // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2339 "movq (%0, %%"REG_c"), %%mm7 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2340 PAVGB((%1, %%REGc), %%mm7) // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2341 "movq %%mm0, (%1) \n\t" // R0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2342 "movq %%mm1, (%1, %2) \n\t" // R1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2343 "movq %%mm2, (%1, %2, 2) \n\t" // R2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2344 "movq %%mm3, (%1, %%"REG_a") \n\t" // R3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2345 "movq %%mm4, (%1, %2, 4) \n\t" // R4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2346 "movq %%mm5, (%1, %%"REG_d") \n\t" // R5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2347 "movq %%mm6, (%1, %%"REG_a", 2) \n\t" // R6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2348 "movq %%mm7, (%1, %%"REG_c") \n\t" // R7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2349 "movq %%mm0, (%0) \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2350 "movq %%mm1, (%0, %2) \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2351 "movq %%mm2, (%0, %2, 2) \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2352 "movq %%mm3, (%0, %%"REG_a") \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2353 "movq %%mm4, (%0, %2, 4) \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2354 "movq %%mm5, (%0, %%"REG_d") \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2355 "movq %%mm6, (%0, %%"REG_a", 2) \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2356 "movq %%mm7, (%0, %%"REG_c") \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2357 "jmp 4f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2358 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2359 "2: \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2360 "cmpl 508(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2361 " jb 3f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2362 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2363 "lea (%%"REG_a", %2, 2), %%"REG_d" \n\t" // 5*stride |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2364 "lea (%%"REG_d", %2, 2), %%"REG_c" \n\t" // 7*stride |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2365 "movq (%0), %%mm0 \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2366 "movq (%0, %2), %%mm1 \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2367 "movq (%0, %2, 2), %%mm2 \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2368 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2369 "movq (%1), %%mm4 \n\t" // R0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2370 "movq (%1, %2), %%mm5 \n\t" // R1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2371 "movq (%1, %2, 2), %%mm6 \n\t" // R2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2372 "movq (%1, %%"REG_a"), %%mm7 \n\t" // R3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2373 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2374 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2375 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2376 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2377 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2378 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2379 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2380 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2381 "movq %%mm0, (%1) \n\t" // R0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2382 "movq %%mm1, (%1, %2) \n\t" // R1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2383 "movq %%mm2, (%1, %2, 2) \n\t" // R2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2384 "movq %%mm3, (%1, %%"REG_a") \n\t" // R3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2385 "movq %%mm0, (%0) \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2386 "movq %%mm1, (%0, %2) \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2387 "movq %%mm2, (%0, %2, 2) \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2388 "movq %%mm3, (%0, %%"REG_a") \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2389 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2390 "movq (%0, %2, 4), %%mm0 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2391 "movq (%0, %%"REG_d"), %%mm1 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2392 "movq (%0, %%"REG_a", 2), %%mm2 \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2393 "movq (%0, %%"REG_c"), %%mm3 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2394 "movq (%1, %2, 4), %%mm4 \n\t" // R4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2395 "movq (%1, %%"REG_d"), %%mm5 \n\t" // R5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2396 "movq (%1, %%"REG_a", 2), %%mm6 \n\t" // R6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2397 "movq (%1, %%"REG_c"), %%mm7 \n\t" // R7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2398 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2399 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2400 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2401 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2402 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2403 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2404 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2405 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2406 "movq %%mm0, (%1, %2, 4) \n\t" // R4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2407 "movq %%mm1, (%1, %%"REG_d") \n\t" // R5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2408 "movq %%mm2, (%1, %%"REG_a", 2) \n\t" // R6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2409 "movq %%mm3, (%1, %%"REG_c") \n\t" // R7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2410 "movq %%mm0, (%0, %2, 4) \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2411 "movq %%mm1, (%0, %%"REG_d") \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2412 "movq %%mm2, (%0, %%"REG_a", 2) \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2413 "movq %%mm3, (%0, %%"REG_c") \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2414 "jmp 4f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2415 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2416 "3: \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2417 "lea (%%"REG_a", %2, 2), %%"REG_d" \n\t" // 5*stride |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2418 "lea (%%"REG_d", %2, 2), %%"REG_c" \n\t" // 7*stride |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2419 "movq (%0), %%mm0 \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2420 "movq (%0, %2), %%mm1 \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2421 "movq (%0, %2, 2), %%mm2 \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2422 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2423 "movq (%1), %%mm4 \n\t" // R0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2424 "movq (%1, %2), %%mm5 \n\t" // R1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2425 "movq (%1, %2, 2), %%mm6 \n\t" // R2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2426 "movq (%1, %%"REG_a"), %%mm7 \n\t" // R3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2427 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2428 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2429 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2430 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2431 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2432 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2433 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2434 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2435 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2436 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2437 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2438 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2439 "movq %%mm0, (%1) \n\t" // R0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2440 "movq %%mm1, (%1, %2) \n\t" // R1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2441 "movq %%mm2, (%1, %2, 2) \n\t" // R2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2442 "movq %%mm3, (%1, %%"REG_a") \n\t" // R3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2443 "movq %%mm0, (%0) \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2444 "movq %%mm1, (%0, %2) \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2445 "movq %%mm2, (%0, %2, 2) \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2446 "movq %%mm3, (%0, %%"REG_a") \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2447 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2448 "movq (%0, %2, 4), %%mm0 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2449 "movq (%0, %%"REG_d"), %%mm1 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2450 "movq (%0, %%"REG_a", 2), %%mm2 \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2451 "movq (%0, %%"REG_c"), %%mm3 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2452 "movq (%1, %2, 4), %%mm4 \n\t" // R4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2453 "movq (%1, %%"REG_d"), %%mm5 \n\t" // R5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2454 "movq (%1, %%"REG_a", 2), %%mm6 \n\t" // R6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2455 "movq (%1, %%"REG_c"), %%mm7 \n\t" // R7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2456 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2457 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2458 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2459 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2460 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2461 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2462 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2463 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2464 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2465 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2466 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2467 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2468 "movq %%mm0, (%1, %2, 4) \n\t" // R4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2469 "movq %%mm1, (%1, %%"REG_d") \n\t" // R5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2470 "movq %%mm2, (%1, %%"REG_a", 2) \n\t" // R6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2471 "movq %%mm3, (%1, %%"REG_c") \n\t" // R7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2472 "movq %%mm0, (%0, %2, 4) \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2473 "movq %%mm1, (%0, %%"REG_d") \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2474 "movq %%mm2, (%0, %%"REG_a", 2) \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2475 "movq %%mm3, (%0, %%"REG_c") \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2476 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2477 "4: \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2478 |
98 | 2479 :: "r" (src), "r" (tempBlurred), "r"((long)stride), "m" (tempBlurredPast) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2480 : "%"REG_a, "%"REG_d, "%"REG_c, "memory" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2481 ); |
0 | 2482 #else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
2483 { | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2484 int y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2485 int d=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2486 // int sysd=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2487 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2488 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2489 for(y=0; y<8; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2490 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2491 for(x=0; x<8; x++){ |
98 | 2492 int ref= tempBlurred[ x + y*stride ]; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2493 int cur= src[ x + y*stride ]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2494 int d1=ref - cur; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2495 // if(x==0 || x==7) d1+= d1>>1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2496 // if(y==0 || y==7) d1+= d1>>1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2497 // d+= FFABS(d1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2498 d+= d1*d1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2499 // sysd+= d1; |
0 | 2500 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2501 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2502 i=d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2503 d= ( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2504 4*d |
98 | 2505 +(*(tempBlurredPast-256)) |
2506 +(*(tempBlurredPast-1))+ (*(tempBlurredPast+1)) | |
2507 +(*(tempBlurredPast+256)) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2508 +4)>>3; |
98 | 2509 *tempBlurredPast=i; |
2510 // ((*tempBlurredPast)*3 + d + 2)>>2; | |
0 | 2511 |
2512 /* | |
2513 Switch between | |
2514 1 0 0 0 0 0 0 (0) | |
2515 64 32 16 8 4 2 1 (1) | |
2516 64 48 36 27 20 15 11 (33) (approx) | |
2517 64 56 49 43 37 33 29 (200) (approx) | |
2518 */ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2519 if(d > maxNoise[1]){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2520 if(d < maxNoise[2]){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2521 for(y=0; y<8; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2522 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2523 for(x=0; x<8; x++){ |
98 | 2524 int ref= tempBlurred[ x + y*stride ]; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2525 int cur= src[ x + y*stride ]; |
98 | 2526 tempBlurred[ x + y*stride ]= |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2527 src[ x + y*stride ]= |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2528 (ref + cur + 1)>>1; |
0 | 2529 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2530 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2531 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2532 for(y=0; y<8; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2533 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2534 for(x=0; x<8; x++){ |
98 | 2535 tempBlurred[ x + y*stride ]= src[ x + y*stride ]; |
0 | 2536 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2537 } |
0 | 2538 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2539 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2540 if(d < maxNoise[0]){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2541 for(y=0; y<8; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2542 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2543 for(x=0; x<8; x++){ |
98 | 2544 int ref= tempBlurred[ x + y*stride ]; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2545 int cur= src[ x + y*stride ]; |
98 | 2546 tempBlurred[ x + y*stride ]= |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2547 src[ x + y*stride ]= |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2548 (ref*7 + cur + 4)>>3; |
0 | 2549 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2550 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2551 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2552 for(y=0; y<8; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2553 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2554 for(x=0; x<8; x++){ |
98 | 2555 int ref= tempBlurred[ x + y*stride ]; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2556 int cur= src[ x + y*stride ]; |
98 | 2557 tempBlurred[ x + y*stride ]= |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2558 src[ x + y*stride ]= |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2559 (ref*3 + cur + 2)>>2; |
0 | 2560 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2561 } |
0 | 2562 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2563 } |
0 | 2564 } |
2565 #endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) | |
2566 } | |
2567 #endif //HAVE_ALTIVEC | |
2568 | |
2569 #ifdef HAVE_MMX | |
2570 /** | |
2571 * accurate deblock filter | |
2572 */ | |
38
63d07317cd7a
rename always_inline to av_always_inline and move to common.h
mru
parents:
32
diff
changeset
|
2573 static av_always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, int stride, PPContext *c){ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2574 int64_t dc_mask, eq_mask, both_masks; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2575 int64_t sums[10*8*2]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2576 src+= step*3; // src points to begin of the 8x8 Block |
0 | 2577 //START_TIMER |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2578 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2579 "movq %0, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2580 "movq %1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2581 : : "m" (c->mmxDcOffset[c->nonBQP]), "m" (c->mmxDcThreshold[c->nonBQP]) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2582 ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2583 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2584 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2585 "lea (%2, %3), %%"REG_a" \n\t" |
0 | 2586 // 0 1 2 3 4 5 6 7 8 9 |
2587 // %1 eax eax+%2 eax+2%2 %1+4%2 ecx ecx+%2 ecx+2%2 %1+8%2 ecx+4%2 | |
2588 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2589 "movq (%2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2590 "movq (%%"REG_a"), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2591 "movq %%mm1, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2592 "movq %%mm1, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2593 "psubb %%mm1, %%mm0 \n\t" // mm0 = differnece |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2594 "paddb %%mm7, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2595 "pcmpgtb %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2596 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2597 "movq (%%"REG_a",%3), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2598 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2599 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2600 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2601 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2602 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2603 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2604 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2605 "movq (%%"REG_a", %3, 2), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2606 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2607 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2608 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2609 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2610 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2611 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2612 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2613 "lea (%%"REG_a", %3, 4), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2614 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2615 "movq (%2, %3, 4), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2616 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2617 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2618 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2619 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2620 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2621 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2622 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2623 "movq (%%"REG_a"), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2624 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2625 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2626 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2627 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2628 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2629 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2630 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2631 "movq (%%"REG_a", %3), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2632 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2633 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2634 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2635 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2636 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2637 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2638 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2639 "movq (%%"REG_a", %3, 2), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2640 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2641 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2642 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2643 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2644 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2645 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2646 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2647 "movq (%2, %3, 8), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2648 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2649 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2650 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2651 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2652 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2653 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2654 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2655 "movq (%%"REG_a", %3, 4), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2656 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2657 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2658 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2659 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2660 "psubusb %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2661 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2662 "pxor %%mm6, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2663 "movq %4, %%mm7 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2664 "paddusb %%mm7, %%mm7 \n\t" // 2QP ... 2QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2665 "psubusb %%mm4, %%mm7 \n\t" // Diff >=2QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2666 "pcmpeqb %%mm6, %%mm7 \n\t" // Diff < 2QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2667 "pcmpeqb %%mm6, %%mm7 \n\t" // Diff < 2QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2668 "movq %%mm7, %1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2669 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2670 "movq %5, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2671 "punpcklbw %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2672 "punpcklbw %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2673 "punpcklbw %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2674 "psubb %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2675 "pcmpgtb %%mm7, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2676 "movq %%mm6, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2677 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2678 : "=m" (eq_mask), "=m" (dc_mask) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2679 : "r" (src), "r" ((long)step), "m" (c->pQPb), "m"(c->ppMode.flatnessThreshold) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2680 : "%"REG_a |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2681 ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2682 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2683 both_masks = dc_mask & eq_mask; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2684 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2685 if(both_masks){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2686 long offset= -8*step; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2687 int64_t *temp_sums= sums; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2688 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2689 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2690 "movq %2, %%mm0 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2691 "pxor %%mm4, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2692 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2693 "movq (%0), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2694 "movq (%0, %1), %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2695 "movq %%mm5, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2696 "movq %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2697 "psubusb %%mm6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2698 "psubusb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2699 "por %%mm5, %%mm2 \n\t" // ABS Diff of lines |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2700 "psubusb %%mm2, %%mm0 \n\t" // diff >= QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2701 "pcmpeqb %%mm4, %%mm0 \n\t" // diff >= QP -> FF |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2702 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2703 "pxor %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2704 "pand %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2705 "pxor %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2706 // 0:QP 6:First |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2707 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2708 "movq (%0, %1, 8), %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2709 "add %1, %0 \n\t" // %0 points to line 1 not 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2710 "movq (%0, %1, 8), %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2711 "movq %%mm5, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2712 "movq %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2713 "psubusb %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2714 "psubusb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2715 "por %%mm5, %%mm2 \n\t" // ABS Diff of lines |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2716 "movq %2, %%mm0 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2717 "psubusb %%mm2, %%mm0 \n\t" // diff >= QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2718 "pcmpeqb %%mm4, %%mm0 \n\t" // diff >= QP -> FF |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2719 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2720 "pxor %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2721 "pand %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2722 "pxor %%mm1, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2723 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2724 "movq %%mm6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2725 "punpckhbw %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2726 "punpcklbw %%mm4, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2727 // 4:0 5/6:First 7:Last |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2728 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2729 "movq %%mm5, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2730 "movq %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2731 "psllw $2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2732 "psllw $2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2733 "paddw "MANGLE(w04)", %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2734 "paddw "MANGLE(w04)", %%mm1 \n\t" |
0 | 2735 |
2736 #define NEXT\ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2737 "movq (%0), %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2738 "movq (%0), %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2739 "add %1, %0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2740 "punpcklbw %%mm4, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2741 "punpckhbw %%mm4, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2742 "paddw %%mm2, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2743 "paddw %%mm3, %%mm1 \n\t" |
0 | 2744 |
2745 #define PREV\ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2746 "movq (%0), %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2747 "movq (%0), %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2748 "add %1, %0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2749 "punpcklbw %%mm4, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2750 "punpckhbw %%mm4, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2751 "psubw %%mm2, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2752 "psubw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2753 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2754 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2755 NEXT //0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2756 NEXT //1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2757 NEXT //2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2758 "movq %%mm0, (%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2759 "movq %%mm1, 8(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2760 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2761 NEXT //3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2762 "psubw %%mm5, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2763 "psubw %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2764 "movq %%mm0, 16(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2765 "movq %%mm1, 24(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2766 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2767 NEXT //4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2768 "psubw %%mm5, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2769 "psubw %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2770 "movq %%mm0, 32(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2771 "movq %%mm1, 40(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2772 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2773 NEXT //5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2774 "psubw %%mm5, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2775 "psubw %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2776 "movq %%mm0, 48(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2777 "movq %%mm1, 56(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2778 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2779 NEXT //6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2780 "psubw %%mm5, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2781 "psubw %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2782 "movq %%mm0, 64(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2783 "movq %%mm1, 72(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2784 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2785 "movq %%mm7, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2786 "punpckhbw %%mm4, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2787 "punpcklbw %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2788 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2789 NEXT //7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2790 "mov %4, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2791 "add %1, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2792 PREV //0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2793 "movq %%mm0, 80(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2794 "movq %%mm1, 88(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2795 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2796 PREV //1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2797 "paddw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2798 "paddw %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2799 "movq %%mm0, 96(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2800 "movq %%mm1, 104(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2801 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2802 PREV //2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2803 "paddw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2804 "paddw %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2805 "movq %%mm0, 112(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2806 "movq %%mm1, 120(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2807 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2808 PREV //3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2809 "paddw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2810 "paddw %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2811 "movq %%mm0, 128(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2812 "movq %%mm1, 136(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2813 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2814 PREV //4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2815 "paddw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2816 "paddw %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2817 "movq %%mm0, 144(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2818 "movq %%mm1, 152(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2819 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2820 "mov %4, %0 \n\t" //FIXME |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2821 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2822 : "+&r"(src) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2823 : "r" ((long)step), "m" (c->pQPb), "r"(sums), "g"(src) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2824 ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2825 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2826 src+= step; // src points to begin of the 8x8 Block |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2827 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2828 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2829 "movq %4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2830 "pcmpeqb %%mm5, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2831 "pxor %%mm6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2832 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2833 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2834 "1: \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2835 "movq (%1), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2836 "movq 8(%1), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2837 "paddw 32(%1), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2838 "paddw 40(%1), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2839 "movq (%0, %3), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2840 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2841 "movq %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2842 "punpcklbw %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2843 "punpckhbw %%mm7, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2844 "paddw %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2845 "paddw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2846 "paddw %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2847 "paddw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2848 "psrlw $4, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2849 "psrlw $4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2850 "packuswb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2851 "pand %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2852 "pand %%mm5, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2853 "por %%mm4, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2854 "movq %%mm0, (%0, %3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2855 "add $16, %1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2856 "add %2, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2857 " js 1b \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2858 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2859 : "+r"(offset), "+r"(temp_sums) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2860 : "r" ((long)step), "r"(src - offset), "m"(both_masks) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2861 ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2862 }else |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2863 src+= step; // src points to begin of the 8x8 Block |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2864 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2865 if(eq_mask != -1LL){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2866 uint8_t *temp_src= src; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2867 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2868 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2869 "lea -40(%%"REG_SP"), %%"REG_c" \n\t" // make space for 4 8-byte vars |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2870 "and "ALIGN_MASK", %%"REG_c" \n\t" // align |
0 | 2871 // 0 1 2 3 4 5 6 7 8 9 |
2872 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %1+8%1 ecx+4%1 | |
2873 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2874 "movq (%0), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2875 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2876 "punpcklbw %%mm7, %%mm0 \n\t" // low part of line 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2877 "punpckhbw %%mm7, %%mm1 \n\t" // high part of line 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2878 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2879 "movq (%0, %1), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2880 "lea (%0, %1, 2), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2881 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2882 "punpcklbw %%mm7, %%mm2 \n\t" // low part of line 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2883 "punpckhbw %%mm7, %%mm3 \n\t" // high part of line 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2884 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2885 "movq (%%"REG_a"), %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2886 "movq %%mm4, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2887 "punpcklbw %%mm7, %%mm4 \n\t" // low part of line 2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2888 "punpckhbw %%mm7, %%mm5 \n\t" // high part of line 2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2889 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2890 "paddw %%mm0, %%mm0 \n\t" // 2L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2891 "paddw %%mm1, %%mm1 \n\t" // 2H0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2892 "psubw %%mm4, %%mm2 \n\t" // L1 - L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2893 "psubw %%mm5, %%mm3 \n\t" // H1 - H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2894 "psubw %%mm2, %%mm0 \n\t" // 2L0 - L1 + L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2895 "psubw %%mm3, %%mm1 \n\t" // 2H0 - H1 + H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2896 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2897 "psllw $2, %%mm2 \n\t" // 4L1 - 4L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2898 "psllw $2, %%mm3 \n\t" // 4H1 - 4H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2899 "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2900 "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2901 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2902 "movq (%%"REG_a", %1), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2903 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2904 "punpcklbw %%mm7, %%mm2 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2905 "punpckhbw %%mm7, %%mm3 \n\t" // H3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2906 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2907 "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 - L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2908 "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 - H3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2909 "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 - 2L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2910 "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 - 2H3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2911 "movq %%mm0, (%%"REG_c") \n\t" // 2L0 - 5L1 + 5L2 - 2L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2912 "movq %%mm1, 8(%%"REG_c") \n\t" // 2H0 - 5H1 + 5H2 - 2H3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2913 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2914 "movq (%%"REG_a", %1, 2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2915 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2916 "punpcklbw %%mm7, %%mm0 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2917 "punpckhbw %%mm7, %%mm1 \n\t" // H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2918 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2919 "psubw %%mm0, %%mm2 \n\t" // L3 - L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2920 "psubw %%mm1, %%mm3 \n\t" // H3 - H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2921 "movq %%mm2, 16(%%"REG_c") \n\t" // L3 - L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2922 "movq %%mm3, 24(%%"REG_c") \n\t" // H3 - H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2923 "paddw %%mm4, %%mm4 \n\t" // 2L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2924 "paddw %%mm5, %%mm5 \n\t" // 2H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2925 "psubw %%mm2, %%mm4 \n\t" // 2L2 - L3 + L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2926 "psubw %%mm3, %%mm5 \n\t" // 2H2 - H3 + H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2927 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2928 "lea (%%"REG_a", %1), %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2929 "psllw $2, %%mm2 \n\t" // 4L3 - 4L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2930 "psllw $2, %%mm3 \n\t" // 4H3 - 4H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2931 "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2932 "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 |
0 | 2933 //50 opcodes so far |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2934 "movq (%0, %1, 2), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2935 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2936 "punpcklbw %%mm7, %%mm2 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2937 "punpckhbw %%mm7, %%mm3 \n\t" // H5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2938 "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 - L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2939 "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 - H5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2940 "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 - 2L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2941 "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 - 2H5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2942 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2943 "movq (%%"REG_a", %1, 4), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2944 "punpcklbw %%mm7, %%mm6 \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2945 "psubw %%mm6, %%mm2 \n\t" // L5 - L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2946 "movq (%%"REG_a", %1, 4), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2947 "punpckhbw %%mm7, %%mm6 \n\t" // H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2948 "psubw %%mm6, %%mm3 \n\t" // H5 - H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2949 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2950 "paddw %%mm0, %%mm0 \n\t" // 2L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2951 "paddw %%mm1, %%mm1 \n\t" // 2H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2952 "psubw %%mm2, %%mm0 \n\t" // 2L4 - L5 + L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2953 "psubw %%mm3, %%mm1 \n\t" // 2H4 - H5 + H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2954 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2955 "psllw $2, %%mm2 \n\t" // 4L5 - 4L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2956 "psllw $2, %%mm3 \n\t" // 4H5 - 4H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2957 "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2958 "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2959 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2960 "movq (%0, %1, 4), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2961 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2962 "punpcklbw %%mm7, %%mm2 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2963 "punpckhbw %%mm7, %%mm3 \n\t" // H7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2964 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2965 "paddw %%mm2, %%mm2 \n\t" // 2L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2966 "paddw %%mm3, %%mm3 \n\t" // 2H7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2967 "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6 - 2L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2968 "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6 - 2H7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2969 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2970 "movq (%%"REG_c"), %%mm2 \n\t" // 2L0 - 5L1 + 5L2 - 2L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2971 "movq 8(%%"REG_c"), %%mm3 \n\t" // 2H0 - 5H1 + 5H2 - 2H3 |
0 | 2972 |
2973 #ifdef HAVE_MMX2 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2974 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2975 "psubw %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2976 "pmaxsw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2977 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2978 "psubw %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2979 "pmaxsw %%mm6, %%mm1 \n\t" // |2H4 - 5H5 + 5H6 - 2H7| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2980 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2981 "psubw %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2982 "pmaxsw %%mm6, %%mm2 \n\t" // |2L0 - 5L1 + 5L2 - 2L3| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2983 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2984 "psubw %%mm3, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2985 "pmaxsw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| |
0 | 2986 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2987 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2988 "pcmpgtw %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2989 "pxor %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2990 "psubw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2991 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2992 "pcmpgtw %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2993 "pxor %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2994 "psubw %%mm6, %%mm1 \n\t" // |2H4 - 5H5 + 5H6 - 2H7| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2995 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2996 "pcmpgtw %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2997 "pxor %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2998 "psubw %%mm6, %%mm2 \n\t" // |2L0 - 5L1 + 5L2 - 2L3| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2999 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3000 "pcmpgtw %%mm3, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3001 "pxor %%mm6, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3002 "psubw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| |
0 | 3003 #endif |
3004 | |
3005 #ifdef HAVE_MMX2 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3006 "pminsw %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3007 "pminsw %%mm3, %%mm1 \n\t" |
0 | 3008 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3009 "movq %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3010 "psubusw %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3011 "psubw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3012 "movq %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3013 "psubusw %%mm3, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3014 "psubw %%mm6, %%mm1 \n\t" |
0 | 3015 #endif |
3016 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3017 "movd %2, %%mm2 \n\t" // QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3018 "punpcklbw %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3019 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3020 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3021 "pcmpgtw %%mm4, %%mm6 \n\t" // sign(2L2 - 5L3 + 5L4 - 2L5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3022 "pxor %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3023 "psubw %%mm6, %%mm4 \n\t" // |2L2 - 5L3 + 5L4 - 2L5| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3024 "pcmpgtw %%mm5, %%mm7 \n\t" // sign(2H2 - 5H3 + 5H4 - 2H5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3025 "pxor %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3026 "psubw %%mm7, %%mm5 \n\t" // |2H2 - 5H3 + 5H4 - 2H5| |
0 | 3027 // 100 opcodes |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3028 "psllw $3, %%mm2 \n\t" // 8QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3029 "movq %%mm2, %%mm3 \n\t" // 8QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3030 "pcmpgtw %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3031 "pcmpgtw %%mm5, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3032 "pand %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3033 "pand %%mm3, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3034 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3035 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3036 "psubusw %%mm0, %%mm4 \n\t" // hd |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3037 "psubusw %%mm1, %%mm5 \n\t" // ld |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3038 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3039 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3040 "movq "MANGLE(w05)", %%mm2 \n\t" // 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3041 "pmullw %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3042 "pmullw %%mm2, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3043 "movq "MANGLE(w20)", %%mm2 \n\t" // 32 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3044 "paddw %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3045 "paddw %%mm2, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3046 "psrlw $6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3047 "psrlw $6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3048 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3049 "movq 16(%%"REG_c"), %%mm0 \n\t" // L3 - L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3050 "movq 24(%%"REG_c"), %%mm1 \n\t" // H3 - H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3051 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3052 "pxor %%mm2, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3053 "pxor %%mm3, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3054 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3055 "pcmpgtw %%mm0, %%mm2 \n\t" // sign (L3-L4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3056 "pcmpgtw %%mm1, %%mm3 \n\t" // sign (H3-H4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3057 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3058 "pxor %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3059 "psubw %%mm2, %%mm0 \n\t" // |L3-L4| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3060 "psubw %%mm3, %%mm1 \n\t" // |H3-H4| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3061 "psrlw $1, %%mm0 \n\t" // |L3 - L4|/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3062 "psrlw $1, %%mm1 \n\t" // |H3 - H4|/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3063 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3064 "pxor %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3065 "pxor %%mm7, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3066 "pand %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3067 "pand %%mm3, %%mm5 \n\t" |
0 | 3068 |
3069 #ifdef HAVE_MMX2 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3070 "pminsw %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3071 "pminsw %%mm1, %%mm5 \n\t" |
0 | 3072 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3073 "movq %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3074 "psubusw %%mm0, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3075 "psubw %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3076 "movq %%mm5, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3077 "psubusw %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3078 "psubw %%mm2, %%mm5 \n\t" |
0 | 3079 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3080 "pxor %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3081 "pxor %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3082 "psubw %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3083 "psubw %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3084 "packsswb %%mm5, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3085 "movq %3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3086 "pandn %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3087 "movq (%0), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3088 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3089 "movq %%mm0, (%0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3090 "movq (%0, %1), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3091 "psubb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3092 "movq %%mm0, (%0, %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3093 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3094 : "+r" (temp_src) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3095 : "r" ((long)step), "m" (c->pQPb), "m"(eq_mask) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3096 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3097 ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3098 } |
0 | 3099 /*if(step==16){ |
3100 STOP_TIMER("step16") | |
3101 }else{ | |
3102 STOP_TIMER("stepX") | |
3103 }*/ | |
3104 } | |
3105 #endif //HAVE_MMX | |
3106 | |
78 | 3107 static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height, |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3108 const QP_STORE_T QPs[], int QPStride, int isColor, PPContext *c); |
0 | 3109 |
3110 /** | |
48 | 3111 * Copies a block from src to dst and fixes the blacklevel. |
3112 * levelFix == 0 -> do not touch the brighness & contrast | |
0 | 3113 */ |
3114 #undef SCALED_CPY | |
3115 | |
78 | 3116 static inline void RENAME(blockCopy)(uint8_t dst[], int dstStride, const uint8_t src[], int srcStride, |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3117 int levelFix, int64_t *packedOffsetAndScale) |
0 | 3118 { |
3119 #ifndef HAVE_MMX | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3120 int i; |
0 | 3121 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3122 if(levelFix){ |
0 | 3123 #ifdef HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3124 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3125 "movq (%%"REG_a"), %%mm2 \n\t" // packedYOffset |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3126 "movq 8(%%"REG_a"), %%mm3 \n\t" // packedYScale |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3127 "lea (%2,%4), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3128 "lea (%3,%5), %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3129 "pxor %%mm4, %%mm4 \n\t" |
0 | 3130 #ifdef HAVE_MMX2 |
3131 #define REAL_SCALED_CPY(src1, src2, dst1, dst2) \ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3132 "movq " #src1 ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3133 "movq " #src1 ", %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3134 "movq " #src2 ", %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3135 "movq " #src2 ", %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3136 "punpcklbw %%mm0, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3137 "punpckhbw %%mm5, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3138 "punpcklbw %%mm1, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3139 "punpckhbw %%mm6, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3140 "pmulhuw %%mm3, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3141 "pmulhuw %%mm3, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3142 "pmulhuw %%mm3, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3143 "pmulhuw %%mm3, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3144 "psubw %%mm2, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3145 "psubw %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3146 "psubw %%mm2, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3147 "psubw %%mm2, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3148 "packuswb %%mm5, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3149 "packuswb %%mm6, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3150 "movq %%mm0, " #dst1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3151 "movq %%mm1, " #dst2 " \n\t"\ |
0 | 3152 |
3153 #else //HAVE_MMX2 | |
3154 #define REAL_SCALED_CPY(src1, src2, dst1, dst2) \ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3155 "movq " #src1 ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3156 "movq " #src1 ", %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3157 "punpcklbw %%mm4, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3158 "punpckhbw %%mm4, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3159 "psubw %%mm2, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3160 "psubw %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3161 "movq " #src2 ", %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3162 "psllw $6, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3163 "psllw $6, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3164 "pmulhw %%mm3, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3165 "movq " #src2 ", %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3166 "pmulhw %%mm3, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3167 "punpcklbw %%mm4, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3168 "punpckhbw %%mm4, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3169 "psubw %%mm2, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3170 "psubw %%mm2, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3171 "psllw $6, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3172 "psllw $6, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3173 "pmulhw %%mm3, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3174 "pmulhw %%mm3, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3175 "packuswb %%mm5, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3176 "packuswb %%mm6, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3177 "movq %%mm0, " #dst1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3178 "movq %%mm1, " #dst2 " \n\t"\ |
0 | 3179 |
3180 #endif //HAVE_MMX2 | |
3181 #define SCALED_CPY(src1, src2, dst1, dst2)\ | |
3182 REAL_SCALED_CPY(src1, src2, dst1, dst2) | |
3183 | |
3184 SCALED_CPY((%2) , (%2, %4) , (%3) , (%3, %5)) | |
3185 SCALED_CPY((%2, %4, 2), (%%REGa, %4, 2), (%3, %5, 2), (%%REGd, %5, 2)) | |
3186 SCALED_CPY((%2, %4, 4), (%%REGa, %4, 4), (%3, %5, 4), (%%REGd, %5, 4)) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3187 "lea (%%"REG_a",%4,4), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3188 "lea (%%"REG_d",%5,4), %%"REG_d" \n\t" |
0 | 3189 SCALED_CPY((%%REGa, %4), (%%REGa, %4, 2), (%%REGd, %5), (%%REGd, %5, 2)) |
3190 | |
3191 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3192 : "=&a" (packedOffsetAndScale) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3193 : "0" (packedOffsetAndScale), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3194 "r"(src), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3195 "r"(dst), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3196 "r" ((long)srcStride), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3197 "r" ((long)dstStride) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3198 : "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3199 ); |
0 | 3200 #else //HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3201 for(i=0; i<8; i++) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3202 memcpy( &(dst[dstStride*i]), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3203 &(src[srcStride*i]), BLOCK_SIZE); |
0 | 3204 #endif //HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3205 }else{ |
0 | 3206 #ifdef HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3207 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3208 "lea (%0,%2), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3209 "lea (%1,%3), %%"REG_d" \n\t" |
0 | 3210 |
3211 #define REAL_SIMPLE_CPY(src1, src2, dst1, dst2) \ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3212 "movq " #src1 ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3213 "movq " #src2 ", %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3214 "movq %%mm0, " #dst1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3215 "movq %%mm1, " #dst2 " \n\t"\ |
0 | 3216 |
3217 #define SIMPLE_CPY(src1, src2, dst1, dst2)\ | |
3218 REAL_SIMPLE_CPY(src1, src2, dst1, dst2) | |
3219 | |
3220 SIMPLE_CPY((%0) , (%0, %2) , (%1) , (%1, %3)) | |
3221 SIMPLE_CPY((%0, %2, 2), (%%REGa, %2, 2), (%1, %3, 2), (%%REGd, %3, 2)) | |
3222 SIMPLE_CPY((%0, %2, 4), (%%REGa, %2, 4), (%1, %3, 4), (%%REGd, %3, 4)) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3223 "lea (%%"REG_a",%2,4), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3224 "lea (%%"REG_d",%3,4), %%"REG_d" \n\t" |
0 | 3225 SIMPLE_CPY((%%REGa, %2), (%%REGa, %2, 2), (%%REGd, %3), (%%REGd, %3, 2)) |
3226 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3227 : : "r" (src), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3228 "r" (dst), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3229 "r" ((long)srcStride), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3230 "r" ((long)dstStride) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3231 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3232 ); |
0 | 3233 #else //HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3234 for(i=0; i<8; i++) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3235 memcpy( &(dst[dstStride*i]), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3236 &(src[srcStride*i]), BLOCK_SIZE); |
0 | 3237 #endif //HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3238 } |
0 | 3239 } |
3240 | |
3241 /** | |
3242 * Duplicates the given 8 src pixels ? times upward | |
3243 */ | |
3244 static inline void RENAME(duplicate)(uint8_t src[], int stride) | |
3245 { | |
3246 #ifdef HAVE_MMX | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3247 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3248 "movq (%0), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3249 "add %1, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3250 "movq %%mm0, (%0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3251 "movq %%mm0, (%0, %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3252 "movq %%mm0, (%0, %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3253 : "+r" (src) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3254 : "r" ((long)-stride) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3255 ); |
0 | 3256 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3257 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3258 uint8_t *p=src; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3259 for(i=0; i<3; i++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3260 p-= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3261 memcpy(p, src, 8); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3262 } |
0 | 3263 #endif |
3264 } | |
3265 | |
3266 /** | |
3267 * Filters array of bytes (Y or U or V values) | |
3268 */ | |
78 | 3269 static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height, |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3270 const QP_STORE_T QPs[], int QPStride, int isColor, PPContext *c2) |
0 | 3271 { |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3272 DECLARE_ALIGNED(8, PPContext, c)= *c2; //copy to stack for faster access |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3273 int x,y; |
0 | 3274 #ifdef COMPILE_TIME_MODE |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3275 const int mode= COMPILE_TIME_MODE; |
0 | 3276 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3277 const int mode= isColor ? c.ppMode.chromMode : c.ppMode.lumMode; |
0 | 3278 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3279 int black=0, white=255; // blackest black and whitest white in the picture |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3280 int QPCorrecture= 256*256; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3281 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3282 int copyAhead; |
0 | 3283 #ifdef HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3284 int i; |
0 | 3285 #endif |
3286 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3287 const int qpHShift= isColor ? 4-c.hChromaSubSample : 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3288 const int qpVShift= isColor ? 4-c.vChromaSubSample : 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3289 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3290 //FIXME remove |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3291 uint64_t * const yHistogram= c.yHistogram; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3292 uint8_t * const tempSrc= srcStride > 0 ? c.tempSrc : c.tempSrc - 23*srcStride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3293 uint8_t * const tempDst= dstStride > 0 ? c.tempDst : c.tempDst - 23*dstStride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3294 //const int mbWidth= isColor ? (width+7)>>3 : (width+15)>>4; |
0 | 3295 |
3296 #ifdef HAVE_MMX | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3297 for(i=0; i<57; i++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3298 int offset= ((i*c.ppMode.baseDcDiff)>>8) + 1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3299 int threshold= offset*2 + 1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3300 c.mmxDcOffset[i]= 0x7F - offset; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3301 c.mmxDcThreshold[i]= 0x7F - threshold; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3302 c.mmxDcOffset[i]*= 0x0101010101010101LL; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3303 c.mmxDcThreshold[i]*= 0x0101010101010101LL; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3304 } |
0 | 3305 #endif |
3306 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3307 if(mode & CUBIC_IPOL_DEINT_FILTER) copyAhead=16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3308 else if( (mode & LINEAR_BLEND_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3309 || (mode & FFMPEG_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3310 || (mode & LOWPASS5_DEINT_FILTER)) copyAhead=14; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3311 else if( (mode & V_DEBLOCK) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3312 || (mode & LINEAR_IPOL_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3313 || (mode & MEDIAN_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3314 || (mode & V_A_DEBLOCK)) copyAhead=13; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3315 else if(mode & V_X1_FILTER) copyAhead=11; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3316 // else if(mode & V_RK1_FILTER) copyAhead=10; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3317 else if(mode & DERING) copyAhead=9; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3318 else copyAhead=8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3319 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3320 copyAhead-= 8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3321 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3322 if(!isColor){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3323 uint64_t sum= 0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3324 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3325 uint64_t maxClipped; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3326 uint64_t clipped; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3327 double scale; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3328 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3329 c.frameNum++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3330 // first frame is fscked so we ignore it |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3331 if(c.frameNum == 1) yHistogram[0]= width*height/64*15/256; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3332 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3333 for(i=0; i<256; i++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3334 sum+= yHistogram[i]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3335 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3336 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3337 /* We always get a completely black picture first. */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3338 maxClipped= (uint64_t)(sum * c.ppMode.maxClippedThreshold); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3339 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3340 clipped= sum; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3341 for(black=255; black>0; black--){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3342 if(clipped < maxClipped) break; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3343 clipped-= yHistogram[black]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3344 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3345 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3346 clipped= sum; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3347 for(white=0; white<256; white++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3348 if(clipped < maxClipped) break; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3349 clipped-= yHistogram[white]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3350 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3351 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3352 scale= (double)(c.ppMode.maxAllowedY - c.ppMode.minAllowedY) / (double)(white-black); |
0 | 3353 |
3354 #ifdef HAVE_MMX2 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3355 c.packedYScale= (uint16_t)(scale*256.0 + 0.5); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3356 c.packedYOffset= (((black*c.packedYScale)>>8) - c.ppMode.minAllowedY) & 0xFFFF; |
0 | 3357 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3358 c.packedYScale= (uint16_t)(scale*1024.0 + 0.5); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3359 c.packedYOffset= (black - c.ppMode.minAllowedY) & 0xFFFF; |
0 | 3360 #endif |
3361 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3362 c.packedYOffset|= c.packedYOffset<<32; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3363 c.packedYOffset|= c.packedYOffset<<16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3364 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3365 c.packedYScale|= c.packedYScale<<32; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3366 c.packedYScale|= c.packedYScale<<16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3367 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3368 if(mode & LEVEL_FIX) QPCorrecture= (int)(scale*256*256 + 0.5); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3369 else QPCorrecture= 256*256; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3370 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3371 c.packedYScale= 0x0100010001000100LL; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3372 c.packedYOffset= 0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3373 QPCorrecture= 256*256; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3374 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3375 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3376 /* copy & deinterlace first row of blocks */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3377 y=-BLOCK_SIZE; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3378 { |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3379 const uint8_t *srcBlock= &(src[y*srcStride]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3380 uint8_t *dstBlock= tempDst + dstStride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3381 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3382 // From this point on it is guaranteed that we can read and write 16 lines downward |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3383 // finish 1 block before the next otherwise we might have a problem |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3384 // with the L1 Cache of the P4 ... or only a few blocks at a time or soemthing |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3385 for(x=0; x<width; x+=BLOCK_SIZE){ |
0 | 3386 |
3387 #ifdef HAVE_MMX2 | |
3388 /* | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3389 prefetchnta(srcBlock + (((x>>2)&6) + 5)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3390 prefetchnta(srcBlock + (((x>>2)&6) + 6)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3391 prefetcht0(dstBlock + (((x>>2)&6) + 5)*dstStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3392 prefetcht0(dstBlock + (((x>>2)&6) + 6)*dstStride + 32); |
0 | 3393 */ |
3394 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3395 asm( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3396 "mov %4, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3397 "shr $2, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3398 "and $6, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3399 "add %5, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3400 "mov %%"REG_a", %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3401 "imul %1, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3402 "imul %3, %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3403 "prefetchnta 32(%%"REG_a", %0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3404 "prefetcht0 32(%%"REG_d", %2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3405 "add %1, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3406 "add %3, %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3407 "prefetchnta 32(%%"REG_a", %0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3408 "prefetcht0 32(%%"REG_d", %2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3409 :: "r" (srcBlock), "r" ((long)srcStride), "r" (dstBlock), "r" ((long)dstStride), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3410 "g" ((long)x), "g" ((long)copyAhead) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3411 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3412 ); |
0 | 3413 |
3414 #elif defined(HAVE_3DNOW) | |
49 | 3415 //FIXME check if this is faster on an 3dnow chip or if it is faster without the prefetch or ... |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3416 /* prefetch(srcBlock + (((x>>3)&3) + 5)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3417 prefetch(srcBlock + (((x>>3)&3) + 9)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3418 prefetchw(dstBlock + (((x>>3)&3) + 5)*dstStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3419 prefetchw(dstBlock + (((x>>3)&3) + 9)*dstStride + 32); |
0 | 3420 */ |
3421 #endif | |
3422 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3423 RENAME(blockCopy)(dstBlock + dstStride*8, dstStride, |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3424 srcBlock + srcStride*8, srcStride, mode & LEVEL_FIX, &c.packedYOffset); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3425 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3426 RENAME(duplicate)(dstBlock + dstStride*8, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3427 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3428 if(mode & LINEAR_IPOL_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3429 RENAME(deInterlaceInterpolateLinear)(dstBlock, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3430 else if(mode & LINEAR_BLEND_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3431 RENAME(deInterlaceBlendLinear)(dstBlock, dstStride, c.deintTemp + x); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3432 else if(mode & MEDIAN_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3433 RENAME(deInterlaceMedian)(dstBlock, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3434 else if(mode & CUBIC_IPOL_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3435 RENAME(deInterlaceInterpolateCubic)(dstBlock, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3436 else if(mode & FFMPEG_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3437 RENAME(deInterlaceFF)(dstBlock, dstStride, c.deintTemp + x); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3438 else if(mode & LOWPASS5_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3439 RENAME(deInterlaceL5)(dstBlock, dstStride, c.deintTemp + x, c.deintTemp + width + x); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3440 /* else if(mode & CUBIC_BLEND_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3441 RENAME(deInterlaceBlendCubic)(dstBlock, dstStride); |
0 | 3442 */ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3443 dstBlock+=8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3444 srcBlock+=8; |
0 | 3445 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3446 if(width==FFABS(dstStride)) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3447 linecpy(dst, tempDst + 9*dstStride, copyAhead, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3448 else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3449 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3450 for(i=0; i<copyAhead; i++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3451 memcpy(dst + i*dstStride, tempDst + (9+i)*dstStride, width); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3452 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3453 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3454 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3455 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3456 for(y=0; y<height; y+=BLOCK_SIZE){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3457 //1% speedup if these are here instead of the inner loop |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3458 const uint8_t *srcBlock= &(src[y*srcStride]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3459 uint8_t *dstBlock= &(dst[y*dstStride]); |
0 | 3460 #ifdef HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3461 uint8_t *tempBlock1= c.tempBlocks; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3462 uint8_t *tempBlock2= c.tempBlocks + 8; |
0 | 3463 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3464 const int8_t *QPptr= &QPs[(y>>qpVShift)*QPStride]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3465 int8_t *nonBQPptr= &c.nonBQPTable[(y>>qpVShift)*FFABS(QPStride)]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3466 int QP=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3467 /* can we mess with a 8x16 block from srcBlock/dstBlock downwards and 1 line upwards |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3468 if not than use a temporary buffer */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3469 if(y+15 >= height){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3470 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3471 /* copy from line (copyAhead) to (copyAhead+7) of src, these will be copied with |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3472 blockcopy to dst later */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3473 linecpy(tempSrc + srcStride*copyAhead, srcBlock + srcStride*copyAhead, |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3474 FFMAX(height-y-copyAhead, 0), srcStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3475 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3476 /* duplicate last line of src to fill the void upto line (copyAhead+7) */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3477 for(i=FFMAX(height-y, 8); i<copyAhead+8; i++) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3478 memcpy(tempSrc + srcStride*i, src + srcStride*(height-1), FFABS(srcStride)); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3479 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3480 /* copy up to (copyAhead+1) lines of dst (line -1 to (copyAhead-1))*/ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3481 linecpy(tempDst, dstBlock - dstStride, FFMIN(height-y+1, copyAhead+1), dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3482 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3483 /* duplicate last line of dst to fill the void upto line (copyAhead) */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3484 for(i=height-y+1; i<=copyAhead; i++) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3485 memcpy(tempDst + dstStride*i, dst + dstStride*(height-1), FFABS(dstStride)); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3486 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3487 dstBlock= tempDst + dstStride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3488 srcBlock= tempSrc; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3489 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3490 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3491 // From this point on it is guaranteed that we can read and write 16 lines downward |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3492 // finish 1 block before the next otherwise we might have a problem |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3493 // with the L1 Cache of the P4 ... or only a few blocks at a time or soemthing |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3494 for(x=0; x<width; x+=BLOCK_SIZE){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3495 const int stride= dstStride; |
0 | 3496 #ifdef HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3497 uint8_t *tmpXchg; |
0 | 3498 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3499 if(isColor){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3500 QP= QPptr[x>>qpHShift]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3501 c.nonBQP= nonBQPptr[x>>qpHShift]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3502 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3503 QP= QPptr[x>>4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3504 QP= (QP* QPCorrecture + 256*128)>>16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3505 c.nonBQP= nonBQPptr[x>>4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3506 c.nonBQP= (c.nonBQP* QPCorrecture + 256*128)>>16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3507 yHistogram[ srcBlock[srcStride*12 + 4] ]++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3508 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3509 c.QP= QP; |
0 | 3510 #ifdef HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3511 asm volatile( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3512 "movd %1, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3513 "packuswb %%mm7, %%mm7 \n\t" // 0, 0, 0, QP, 0, 0, 0, QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3514 "packuswb %%mm7, %%mm7 \n\t" // 0,QP, 0, QP, 0,QP, 0, QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3515 "packuswb %%mm7, %%mm7 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3516 "movq %%mm7, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3517 : "=m" (c.pQPb) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3518 : "r" (QP) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3519 ); |
0 | 3520 #endif |
3521 | |
3522 | |
3523 #ifdef HAVE_MMX2 | |
3524 /* | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3525 prefetchnta(srcBlock + (((x>>2)&6) + 5)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3526 prefetchnta(srcBlock + (((x>>2)&6) + 6)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3527 prefetcht0(dstBlock + (((x>>2)&6) + 5)*dstStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3528 prefetcht0(dstBlock + (((x>>2)&6) + 6)*dstStride + 32); |
0 | 3529 */ |
3530 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3531 asm( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3532 "mov %4, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3533 "shr $2, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3534 "and $6, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3535 "add %5, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3536 "mov %%"REG_a", %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3537 "imul %1, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3538 "imul %3, %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3539 "prefetchnta 32(%%"REG_a", %0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3540 "prefetcht0 32(%%"REG_d", %2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3541 "add %1, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3542 "add %3, %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3543 "prefetchnta 32(%%"REG_a", %0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3544 "prefetcht0 32(%%"REG_d", %2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3545 :: "r" (srcBlock), "r" ((long)srcStride), "r" (dstBlock), "r" ((long)dstStride), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3546 "g" ((long)x), "g" ((long)copyAhead) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3547 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3548 ); |
0 | 3549 |
3550 #elif defined(HAVE_3DNOW) | |
49 | 3551 //FIXME check if this is faster on an 3dnow chip or if it is faster without the prefetch or ... |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3552 /* prefetch(srcBlock + (((x>>3)&3) + 5)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3553 prefetch(srcBlock + (((x>>3)&3) + 9)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3554 prefetchw(dstBlock + (((x>>3)&3) + 5)*dstStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3555 prefetchw(dstBlock + (((x>>3)&3) + 9)*dstStride + 32); |
0 | 3556 */ |
3557 #endif | |
3558 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3559 RENAME(blockCopy)(dstBlock + dstStride*copyAhead, dstStride, |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3560 srcBlock + srcStride*copyAhead, srcStride, mode & LEVEL_FIX, &c.packedYOffset); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3561 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3562 if(mode & LINEAR_IPOL_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3563 RENAME(deInterlaceInterpolateLinear)(dstBlock, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3564 else if(mode & LINEAR_BLEND_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3565 RENAME(deInterlaceBlendLinear)(dstBlock, dstStride, c.deintTemp + x); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3566 else if(mode & MEDIAN_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3567 RENAME(deInterlaceMedian)(dstBlock, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3568 else if(mode & CUBIC_IPOL_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3569 RENAME(deInterlaceInterpolateCubic)(dstBlock, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3570 else if(mode & FFMPEG_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3571 RENAME(deInterlaceFF)(dstBlock, dstStride, c.deintTemp + x); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3572 else if(mode & LOWPASS5_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3573 RENAME(deInterlaceL5)(dstBlock, dstStride, c.deintTemp + x, c.deintTemp + width + x); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3574 /* else if(mode & CUBIC_BLEND_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3575 RENAME(deInterlaceBlendCubic)(dstBlock, dstStride); |
0 | 3576 */ |
3577 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3578 /* only deblock if we have 2 blocks */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3579 if(y + 8 < height){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3580 if(mode & V_X1_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3581 RENAME(vertX1Filter)(dstBlock, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3582 else if(mode & V_DEBLOCK){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3583 const int t= RENAME(vertClassify)(dstBlock, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3584 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3585 if(t==1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3586 RENAME(doVertLowPass)(dstBlock, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3587 else if(t==2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3588 RENAME(doVertDefFilter)(dstBlock, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3589 }else if(mode & V_A_DEBLOCK){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3590 RENAME(do_a_deblock)(dstBlock, stride, 1, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3591 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3592 } |
0 | 3593 |
3594 #ifdef HAVE_MMX | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3595 RENAME(transpose1)(tempBlock1, tempBlock2, dstBlock, dstStride); |
0 | 3596 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3597 /* check if we have a previous block to deblock it with dstBlock */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3598 if(x - 8 >= 0){ |
0 | 3599 #ifdef HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3600 if(mode & H_X1_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3601 RENAME(vertX1Filter)(tempBlock1, 16, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3602 else if(mode & H_DEBLOCK){ |
0 | 3603 //START_TIMER |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3604 const int t= RENAME(vertClassify)(tempBlock1, 16, &c); |
0 | 3605 //STOP_TIMER("dc & minmax") |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3606 if(t==1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3607 RENAME(doVertLowPass)(tempBlock1, 16, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3608 else if(t==2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3609 RENAME(doVertDefFilter)(tempBlock1, 16, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3610 }else if(mode & H_A_DEBLOCK){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3611 RENAME(do_a_deblock)(tempBlock1, 16, 1, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3612 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3613 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3614 RENAME(transpose2)(dstBlock-4, dstStride, tempBlock1 + 4*16); |
0 | 3615 |
3616 #else | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3617 if(mode & H_X1_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3618 horizX1Filter(dstBlock-4, stride, QP); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3619 else if(mode & H_DEBLOCK){ |
0 | 3620 #ifdef HAVE_ALTIVEC |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3621 DECLARE_ALIGNED(16, unsigned char, tempBlock[272]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3622 transpose_16x8_char_toPackedAlign_altivec(tempBlock, dstBlock - (4 + 1), stride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3623 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3624 const int t=vertClassify_altivec(tempBlock-48, 16, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3625 if(t==1) { |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3626 doVertLowPass_altivec(tempBlock-48, 16, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3627 transpose_8x16_char_fromPackedAlign_altivec(dstBlock - (4 + 1), tempBlock, stride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3628 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3629 else if(t==2) { |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3630 doVertDefFilter_altivec(tempBlock-48, 16, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3631 transpose_8x16_char_fromPackedAlign_altivec(dstBlock - (4 + 1), tempBlock, stride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3632 } |
0 | 3633 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3634 const int t= RENAME(horizClassify)(dstBlock-4, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3635 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3636 if(t==1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3637 RENAME(doHorizLowPass)(dstBlock-4, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3638 else if(t==2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3639 RENAME(doHorizDefFilter)(dstBlock-4, stride, &c); |
0 | 3640 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3641 }else if(mode & H_A_DEBLOCK){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3642 RENAME(do_a_deblock)(dstBlock-8, 1, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3643 } |
0 | 3644 #endif //HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3645 if(mode & DERING){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3646 //FIXME filter first line |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3647 if(y>0) RENAME(dering)(dstBlock - stride - 8, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3648 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3649 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3650 if(mode & TEMP_NOISE_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3651 { |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3652 RENAME(tempNoiseReducer)(dstBlock-8, stride, |
98 | 3653 c.tempBlurred[isColor] + y*dstStride + x, |
3654 c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3), | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3655 c.ppMode.maxTmpNoise); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3656 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3657 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3658 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3659 dstBlock+=8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3660 srcBlock+=8; |
0 | 3661 |
3662 #ifdef HAVE_MMX | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3663 tmpXchg= tempBlock1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3664 tempBlock1= tempBlock2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3665 tempBlock2 = tmpXchg; |
0 | 3666 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3667 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3668 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3669 if(mode & DERING){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3670 if(y > 0) RENAME(dering)(dstBlock - dstStride - 8, dstStride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3671 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3672 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3673 if((mode & TEMP_NOISE_FILTER)){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3674 RENAME(tempNoiseReducer)(dstBlock-8, dstStride, |
98 | 3675 c.tempBlurred[isColor] + y*dstStride + x, |
3676 c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3), | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3677 c.ppMode.maxTmpNoise); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3678 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3679 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3680 /* did we use a tmp buffer for the last lines*/ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3681 if(y+15 >= height){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3682 uint8_t *dstBlock= &(dst[y*dstStride]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3683 if(width==FFABS(dstStride)) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3684 linecpy(dstBlock, tempDst + dstStride, height-y, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3685 else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3686 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3687 for(i=0; i<height-y; i++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3688 memcpy(dstBlock + i*dstStride, tempDst + (i+1)*dstStride, width); |
0 | 3689 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3690 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3691 } |
0 | 3692 /* |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3693 for(x=0; x<width; x+=32){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3694 volatile int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3695 i+= + dstBlock[x + 7*dstStride] + dstBlock[x + 8*dstStride] |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3696 + dstBlock[x + 9*dstStride] + dstBlock[x +10*dstStride] |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3697 + dstBlock[x +11*dstStride] + dstBlock[x +12*dstStride]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3698 + dstBlock[x +13*dstStride] |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3699 + dstBlock[x +14*dstStride] + dstBlock[x +15*dstStride]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3700 }*/ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3701 } |
0 | 3702 #ifdef HAVE_3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3703 asm volatile("femms"); |
0 | 3704 #elif defined (HAVE_MMX) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3705 asm volatile("emms"); |
0 | 3706 #endif |
3707 | |
3708 #ifdef DEBUG_BRIGHTNESS | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3709 if(!isColor){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3710 int max=1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3711 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3712 for(i=0; i<256; i++) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3713 if(yHistogram[i] > max) max=yHistogram[i]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3714 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3715 for(i=1; i<256; i++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3716 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3717 int start=yHistogram[i-1]/(max/256+1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3718 int end=yHistogram[i]/(max/256+1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3719 int inc= end > start ? 1 : -1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3720 for(x=start; x!=end+inc; x+=inc) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3721 dst[ i*dstStride + x]+=128; |
0 | 3722 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3723 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3724 for(i=0; i<100; i+=2){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3725 dst[ (white)*dstStride + i]+=128; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3726 dst[ (black)*dstStride + i]+=128; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3727 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3728 } |
0 | 3729 #endif |
3730 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3731 *c2= c; //copy local context back |
0 | 3732 |
3733 } |