Mercurial > libpostproc.hg
annotate postprocess_template.c @ 136:fe0bf26c4c81 libpostproc
Fix grammar errors in documentation
author | mru |
---|---|
date | Wed, 30 Jun 2010 15:38:06 +0000 |
parents | 0397ed4317ef |
children |
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 /** | |
135
0397ed4317ef
Remove explicit filename from Doxygen @file commands.
diego
parents:
134
diff
changeset
|
22 * @file |
0 | 23 * mmx/mmx2/3dnow postprocess code. |
24 */ | |
25 | |
108 | 26 #include "libavutil/x86_cpu.h" |
0 | 27 |
92 | 28 #define ALIGN_MASK "$-8" |
0 | 29 |
134
ced16a4fbbec
Fix warnings about redefining constants when compiling libpostproc.
cehoyos
parents:
133
diff
changeset
|
30 #undef REAL_PAVGB |
0 | 31 #undef PAVGB |
32 #undef PMINUB | |
33 #undef PMAXUB | |
34 | |
118 | 35 #if HAVE_MMX2 |
0 | 36 #define REAL_PAVGB(a,b) "pavgb " #a ", " #b " \n\t" |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
37 #elif HAVE_AMD3DNOW |
0 | 38 #define REAL_PAVGB(a,b) "pavgusb " #a ", " #b " \n\t" |
39 #endif | |
40 #define PAVGB(a,b) REAL_PAVGB(a,b) | |
41 | |
118 | 42 #if HAVE_MMX2 |
0 | 43 #define PMINUB(a,b,t) "pminub " #a ", " #b " \n\t" |
118 | 44 #elif HAVE_MMX |
0 | 45 #define PMINUB(b,a,t) \ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
46 "movq " #a ", " #t " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
47 "psubusb " #b ", " #t " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
48 "psubb " #t ", " #a " \n\t" |
0 | 49 #endif |
50 | |
118 | 51 #if HAVE_MMX2 |
0 | 52 #define PMAXUB(a,b) "pmaxub " #a ", " #b " \n\t" |
118 | 53 #elif HAVE_MMX |
0 | 54 #define PMAXUB(a,b) \ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
55 "psubusb " #a ", " #b " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
56 "paddb " #a ", " #b " \n\t" |
0 | 57 #endif |
58 | |
48 | 59 //FIXME? |255-0| = 1 (should not be a problem ...) |
118 | 60 #if HAVE_MMX |
0 | 61 /** |
62 * Check if the middle 8x8 Block in the given 8x16 block is flat | |
63 */ | |
64 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
|
65 int numEq= 0, dcOk; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
66 src+= stride*4; // src points to begin of the 8x8 Block |
112 | 67 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
68 "movq %0, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
69 "movq %1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
70 : : "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
|
71 ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
72 |
112 | 73 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
74 "lea (%2, %3), %%"REG_a" \n\t" |
0 | 75 // 0 1 2 3 4 5 6 7 8 9 |
76 // %1 eax eax+%2 eax+2%2 %1+4%2 ecx ecx+%2 ecx+2%2 %1+8%2 ecx+4%2 | |
77 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
78 "movq (%2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
79 "movq (%%"REG_a"), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
80 "movq %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
81 "movq %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
82 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
83 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
84 "psubb %%mm1, %%mm0 \n\t" // mm0 = differnece |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
85 "paddb %%mm7, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
86 "pcmpgtb %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
87 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
88 "movq (%%"REG_a",%3), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
89 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
90 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
91 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
92 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
93 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
94 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
95 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
96 "movq (%%"REG_a", %3, 2), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
97 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
98 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
99 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
100 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
101 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
102 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
103 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
104 "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
|
105 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
106 "movq (%2, %3, 4), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
107 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
108 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
109 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
110 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
111 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
112 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
113 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
114 "movq (%%"REG_a"), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
115 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
116 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
117 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
118 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
119 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
120 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
121 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
122 "movq (%%"REG_a", %3), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
123 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
124 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
125 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
126 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
127 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
128 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
129 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
130 "movq (%%"REG_a", %3, 2), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
131 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
132 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
133 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
134 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
135 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
136 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
137 "psubusb %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
138 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
139 " \n\t" |
118 | 140 #if HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
141 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
142 "psadbw %%mm7, %%mm0 \n\t" |
0 | 143 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
144 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
145 "psrlw $8, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
146 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
147 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
148 "psrlq $16, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
149 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
150 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
151 "psrlq $32, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
152 "paddb %%mm1, %%mm0 \n\t" |
0 | 153 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
154 "movq %4, %%mm7 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
155 "paddusb %%mm7, %%mm7 \n\t" // 2QP ... 2QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
156 "psubusb %%mm7, %%mm4 \n\t" // Diff <= 2QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
157 "packssdw %%mm4, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
158 "movd %%mm0, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
159 "movd %%mm4, %1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
160 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
161 : "=r" (numEq), "=r" (dcOk) |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
162 : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
163 : "%"REG_a |
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 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
166 numEq= (-numEq) &0xFF; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
167 if(numEq > c->ppMode.flatnessThreshold){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
168 if(dcOk) return 0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
169 else return 1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
170 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
171 return 2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
172 } |
0 | 173 } |
174 #endif //HAVE_MMX | |
175 | |
176 /** | |
177 * Do a vertical low pass filter on the 8x16 block (only write to the 8x8 block in the middle) | |
178 * using the 9-Tap Filter (1,1,2,2,4,2,2,1,1)/16 | |
179 */ | |
118 | 180 #if !HAVE_ALTIVEC |
0 | 181 static inline void RENAME(doVertLowPass)(uint8_t *src, int stride, PPContext *c) |
182 { | |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
183 #if HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
184 src+= stride*3; |
112 | 185 __asm__ volatile( //"movv %0 %1 %2\n\t" |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
186 "movq %2, %%mm0 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
187 "pxor %%mm4, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
188 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
189 "movq (%0), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
190 "movq (%0, %1), %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
191 "movq %%mm5, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
192 "movq %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
193 "psubusb %%mm6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
194 "psubusb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
195 "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
|
196 "psubusb %%mm0, %%mm2 \n\t" // diff <= QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
197 "pcmpeqb %%mm4, %%mm2 \n\t" // diff <= QP -> FF |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
198 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
199 "pand %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
200 "pandn %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
201 "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
|
202 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
203 "movq (%0, %1, 8), %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
204 "lea (%0, %1, 4), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
205 "lea (%0, %1, 8), %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
206 "sub %1, %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
207 "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
|
208 "movq (%0, %1, 8), %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
209 "movq %%mm5, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
210 "movq %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
211 "psubusb %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
212 "psubusb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
213 "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
|
214 "psubusb %%mm0, %%mm2 \n\t" // diff <= QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
215 "pcmpeqb %%mm4, %%mm2 \n\t" // diff <= QP -> FF |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
216 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
217 "pand %%mm2, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
218 "pandn %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
219 "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
|
220 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
221 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
222 // 1 2 3 4 5 6 7 8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
223 // %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
|
224 // 6 4 2 2 1 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
225 // 6 4 4 2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
226 // 6 8 2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
227 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
228 "movq (%0, %1), %%mm0 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
229 "movq %%mm0, %%mm1 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
230 PAVGB(%%mm6, %%mm0) //1 1 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
231 PAVGB(%%mm6, %%mm0) //3 1 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
232 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
233 "movq (%0, %1, 4), %%mm2 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
234 "movq %%mm2, %%mm5 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
235 PAVGB((%%REGa), %%mm2) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
236 PAVGB((%0, %1, 2), %%mm2) // 211 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
237 "movq %%mm2, %%mm3 \n\t" // 211 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
238 "movq (%0), %%mm4 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
239 PAVGB(%%mm4, %%mm3) // 4 211 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
240 PAVGB(%%mm0, %%mm3) //642211 /16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
241 "movq %%mm3, (%0) \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
242 // 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
|
243 "movq %%mm1, %%mm0 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
244 PAVGB(%%mm6, %%mm0) //1 1 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
245 "movq %%mm4, %%mm3 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
246 PAVGB((%0,%1,2), %%mm3) // 1 1 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
247 PAVGB((%%REGa,%1,2), %%mm5) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
248 PAVGB((%%REGa), %%mm5) // 211 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
249 PAVGB(%%mm5, %%mm3) // 2 2211 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
250 PAVGB(%%mm0, %%mm3) //4242211 /16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
251 "movq %%mm3, (%0,%1) \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
252 // 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
|
253 PAVGB(%%mm4, %%mm6) //11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
254 "movq (%%"REG_c"), %%mm0 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
255 PAVGB((%%REGa, %1, 2), %%mm0) // 11/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
256 "movq %%mm0, %%mm3 \n\t" // 11/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
257 PAVGB(%%mm1, %%mm0) // 2 11/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
258 PAVGB(%%mm6, %%mm0) //222 11/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
259 PAVGB(%%mm2, %%mm0) //22242211/16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
260 "movq (%0, %1, 2), %%mm2 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
261 "movq %%mm0, (%0, %1, 2) \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
262 // 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
|
263 "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
|
264 PAVGB((%%REGc), %%mm0) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
265 PAVGB(%%mm0, %%mm6) //11 11 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
266 PAVGB(%%mm1, %%mm4) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
267 PAVGB(%%mm2, %%mm1) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
268 PAVGB(%%mm1, %%mm6) //1122 11 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
269 PAVGB(%%mm5, %%mm6) //112242211 /16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
270 "movq (%%"REG_a"), %%mm5 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
271 "movq %%mm6, (%%"REG_a") \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
272 // 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
|
273 "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
|
274 PAVGB(%%mm7, %%mm6) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
275 PAVGB(%%mm4, %%mm6) // 11 11 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
276 PAVGB(%%mm3, %%mm6) // 11 2211 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
277 PAVGB(%%mm5, %%mm2) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
278 "movq (%0, %1, 4), %%mm4 \n\t" // 1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
279 PAVGB(%%mm4, %%mm2) // 112 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
280 PAVGB(%%mm2, %%mm6) // 112242211 /16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
281 "movq %%mm6, (%0, %1, 4) \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
282 // 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
|
283 PAVGB(%%mm7, %%mm1) // 11 2 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
284 PAVGB(%%mm4, %%mm5) // 11 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
285 PAVGB(%%mm5, %%mm0) // 11 11 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
286 "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
|
287 PAVGB(%%mm6, %%mm1) // 11 4 2 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
288 PAVGB(%%mm0, %%mm1) // 11224222 /16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
289 "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
|
290 // 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
|
291 PAVGB((%%REGc), %%mm2) // 112 4 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
292 "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
|
293 PAVGB(%%mm0, %%mm6) // 1 1 /2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
294 PAVGB(%%mm7, %%mm6) // 1 12 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
295 PAVGB(%%mm2, %%mm6) // 1122424 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
296 "movq %%mm6, (%%"REG_c") \n\t" // X |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
297 // 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
|
298 PAVGB(%%mm7, %%mm5) // 11 2 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
299 PAVGB(%%mm7, %%mm5) // 11 6 /8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
300 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
301 PAVGB(%%mm3, %%mm0) // 112 /4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
302 PAVGB(%%mm0, %%mm5) // 112246 /16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
303 "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
|
304 "sub %1, %0 \n\t" |
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 : |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
307 : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
308 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
309 ); |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
310 #else //HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
311 const int l1= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
312 const int l2= stride + l1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
313 const int l3= stride + l2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
314 const int l4= stride + l3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
315 const int l5= stride + l4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
316 const int l6= stride + l5; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
317 const int l7= stride + l6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
318 const int l8= stride + l7; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
319 const int l9= stride + l8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
320 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
321 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
322 for(x=0; x<BLOCK_SIZE; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
323 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
|
324 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
|
325 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
326 int sums[10]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
327 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
|
328 sums[1] = sums[0] - first + src[l4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
329 sums[2] = sums[1] - first + src[l5]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
330 sums[3] = sums[2] - first + src[l6]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
331 sums[4] = sums[3] - first + src[l7]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
332 sums[5] = sums[4] - src[l1] + src[l8]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
333 sums[6] = sums[5] - src[l2] + last; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
334 sums[7] = sums[6] - src[l3] + last; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
335 sums[8] = sums[7] - src[l4] + last; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
336 sums[9] = sums[8] - src[l5] + last; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
337 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
338 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
|
339 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
|
340 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
|
341 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
|
342 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
|
343 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
|
344 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
|
345 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
|
346 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
347 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
348 } |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
349 #endif //HAVE_MMX2 || HAVE_AMD3DNOW |
0 | 350 } |
351 #endif //HAVE_ALTIVEC | |
352 | |
353 /** | |
354 * Experimental Filter 1 | |
355 * will not damage linear gradients | |
90 | 356 * Flat blocks should look like they were passed through the (1,1,2,2,4,2,2,1,1) 9-Tap filter |
48 | 357 * can only smooth blocks at the expected locations (it cannot smooth them if they did move) |
358 * MMX2 version does correct clipping C version does not | |
0 | 359 */ |
360 static inline void RENAME(vertX1Filter)(uint8_t *src, int stride, PPContext *co) | |
361 { | |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
362 #if HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
363 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
364 |
112 | 365 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
366 "pxor %%mm7, %%mm7 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
367 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
368 "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t" |
0 | 369 // 0 1 2 3 4 5 6 7 8 9 |
370 // %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
|
371 "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
|
372 "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
|
373 "movq %%mm1, %%mm2 \n\t" // line 4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
374 "psubusb %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
375 "psubusb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
376 "por %%mm1, %%mm0 \n\t" // |l2 - l3| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
377 "movq (%%"REG_c"), %%mm3 \n\t" // line 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
378 "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
|
379 "movq %%mm3, %%mm5 \n\t" // line 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
380 "psubusb %%mm4, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
381 "psubusb %%mm5, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
382 "por %%mm4, %%mm3 \n\t" // |l5 - l6| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
383 PAVGB(%%mm3, %%mm0) // (|l2 - l3| + |l5 - l6|)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
384 "movq %%mm2, %%mm1 \n\t" // line 4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
385 "psubusb %%mm5, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
386 "movq %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
387 "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
|
388 "psubusb %%mm1, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
389 "por %%mm5, %%mm4 \n\t" // |l4 - l5| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
390 "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
|
391 "movq %%mm4, %%mm3 \n\t" // d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
392 "movq %2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
393 "paddusb %%mm0, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
394 "psubusb %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
395 "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
|
396 "psubusb "MANGLE(b01)", %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
397 "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
|
398 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
399 PAVGB(%%mm7, %%mm3) // d/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
400 "movq %%mm3, %%mm1 \n\t" // d/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
401 PAVGB(%%mm7, %%mm3) // d/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
402 PAVGB(%%mm1, %%mm3) // 3*d/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
403 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
404 "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
|
405 "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
|
406 "psubusb %%mm3, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
407 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
408 "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
|
409 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
410 "movq (%%"REG_c"), %%mm0 \n\t" // line 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
411 "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
|
412 "paddusb %%mm3, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
413 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
414 "movq %%mm0, (%%"REG_c") \n\t" // line 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
415 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
416 PAVGB(%%mm7, %%mm1) // d/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
417 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
418 "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
|
419 "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
|
420 "psubusb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
421 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
422 "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
|
423 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
424 "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
|
425 "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
|
426 "paddusb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
427 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
428 "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
|
429 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
430 PAVGB(%%mm7, %%mm1) // d/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
431 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
432 "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
|
433 "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
|
434 "psubusb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
435 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
436 "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
|
437 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
438 "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
|
439 "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
|
440 "paddusb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
441 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
442 "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
|
443 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
444 : |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
445 : "r" (src), "r" ((x86_reg)stride), "m" (co->pQPb) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
446 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
447 ); |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
448 #else //HAVE_MMX2 || HAVE_AMD3DNOW |
0 | 449 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
450 const int l1= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
451 const int l2= stride + l1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
452 const int l3= stride + l2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
453 const int l4= stride + l3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
454 const int l5= stride + l4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
455 const int l6= stride + l5; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
456 const int l7= stride + l6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
457 // const int l8= stride + l7; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
458 // const int l9= stride + l8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
459 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
460 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
461 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
462 for(x=0; x<BLOCK_SIZE; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
463 int a= src[l3] - src[l4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
464 int b= src[l4] - src[l5]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
465 int c= src[l5] - src[l6]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
466 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
467 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
|
468 d= FFMAX(d, 0); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
469 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
470 if(d < co->QP*2){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
471 int v = d * FFSIGN(-b); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
472 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
473 src[l2] +=v>>3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
474 src[l3] +=v>>2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
475 src[l4] +=(3*v)>>3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
476 src[l5] -=(3*v)>>3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
477 src[l6] -=v>>2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
478 src[l7] -=v>>3; |
0 | 479 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
480 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
481 } |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
482 #endif //HAVE_MMX2 || HAVE_AMD3DNOW |
0 | 483 } |
484 | |
118 | 485 #if !HAVE_ALTIVEC |
0 | 486 static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext *c) |
487 { | |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
488 #if HAVE_MMX2 || HAVE_AMD3DNOW |
0 | 489 /* |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
490 uint8_t tmp[16]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
491 const int l1= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
492 const int l2= stride + l1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
493 const int l3= stride + l2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
494 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
|
495 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
|
496 const int l6= stride*3 + l3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
497 const int l7= stride + l6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
498 const int l8= stride + l7; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
499 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
500 memcpy(tmp, src+stride*7, 8); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
501 memcpy(tmp+8, src+stride*8, 8); |
0 | 502 */ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
503 src+= stride*4; |
112 | 504 __asm__ volatile( |
0 | 505 |
97 | 506 #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
|
507 "pxor %%mm7, %%mm7 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
508 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
509 "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t" |
0 | 510 // 0 1 2 3 4 5 6 7 |
511 // %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 ecx+%1 ecx+2%1 | |
512 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 | |
513 | |
514 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
515 "movq (%0, %1, 2), %%mm0 \n\t" // l2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
516 "movq (%0), %%mm1 \n\t" // l0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
517 "movq %%mm0, %%mm2 \n\t" // l2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
518 PAVGB(%%mm7, %%mm0) // ~l2/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
519 PAVGB(%%mm1, %%mm0) // ~(l2 + 2l0)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
520 PAVGB(%%mm2, %%mm0) // ~(5l2 + 2l0)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
521 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
522 "movq (%%"REG_a"), %%mm1 \n\t" // l1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
523 "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
|
524 "movq %%mm1, %%mm4 \n\t" // l1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
525 PAVGB(%%mm7, %%mm1) // ~l1/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
526 PAVGB(%%mm3, %%mm1) // ~(l1 + 2l3)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
527 PAVGB(%%mm4, %%mm1) // ~(5l1 + 2l3)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
528 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
529 "movq %%mm0, %%mm4 \n\t" // ~(5l2 + 2l0)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
530 "psubusb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
531 "psubusb %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
532 "por %%mm0, %%mm1 \n\t" // ~|2l0 - 5l1 + 5l2 - 2l3|/8 |
0 | 533 // mm1= |lenergy|, mm2= l2, mm3= l3, mm7=0 |
534 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
535 "movq (%0, %1, 4), %%mm0 \n\t" // l4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
536 "movq %%mm0, %%mm4 \n\t" // l4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
537 PAVGB(%%mm7, %%mm0) // ~l4/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
538 PAVGB(%%mm2, %%mm0) // ~(l4 + 2l2)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
539 PAVGB(%%mm4, %%mm0) // ~(5l4 + 2l2)/8 |
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"), %%mm2 \n\t" // l5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
542 "movq %%mm3, %%mm5 \n\t" // l3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
543 PAVGB(%%mm7, %%mm3) // ~l3/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
544 PAVGB(%%mm2, %%mm3) // ~(l3 + 2l5)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
545 PAVGB(%%mm5, %%mm3) // ~(5l3 + 2l5)/8 |
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 "movq %%mm0, %%mm6 \n\t" // ~(5l4 + 2l2)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
548 "psubusb %%mm3, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
549 "psubusb %%mm6, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
550 "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
|
551 "pcmpeqb %%mm7, %%mm0 \n\t" // SIGN(2l2 - 5l3 + 5l4 - 2l5) |
0 | 552 // mm0= SIGN(menergy), mm1= |lenergy|, mm2= l5, mm3= |menergy|, mm4=l4, mm5= l3, mm7=0 |
553 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
554 "movq (%%"REG_c", %1), %%mm6 \n\t" // l6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
555 "movq %%mm6, %%mm5 \n\t" // l6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
556 PAVGB(%%mm7, %%mm6) // ~l6/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
557 PAVGB(%%mm4, %%mm6) // ~(l6 + 2l4)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
558 PAVGB(%%mm5, %%mm6) // ~(5l6 + 2l4)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
559 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
560 "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
|
561 "movq %%mm2, %%mm4 \n\t" // l5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
562 PAVGB(%%mm7, %%mm2) // ~l5/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
563 PAVGB(%%mm5, %%mm2) // ~(l5 + 2l7)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
564 PAVGB(%%mm4, %%mm2) // ~(5l5 + 2l7)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
565 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
566 "movq %%mm6, %%mm4 \n\t" // ~(5l6 + 2l4)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
567 "psubusb %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
568 "psubusb %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
569 "por %%mm6, %%mm2 \n\t" // ~|2l4 - 5l5 + 5l6 - 2l7|/8 |
0 | 570 // mm0= SIGN(menergy), mm1= |lenergy|/8, mm2= |renergy|/8, mm3= |menergy|/8, mm7=0 |
571 | |
572 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
573 PMINUB(%%mm2, %%mm1, %%mm4) // MIN(|lenergy|,|renergy|)/8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
574 "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
|
575 "paddusb "MANGLE(b01)", %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
576 "pcmpgtb %%mm3, %%mm4 \n\t" // |menergy|/8 < QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
577 "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
|
578 "pand %%mm4, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
579 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
580 "movq %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
581 // "psubusb "MANGLE(b01)", %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
582 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
583 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
584 "paddusb %%mm1, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
585 // "paddusb "MANGLE(b01)", %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
586 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
587 "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
|
588 "movq (%0, %1, 4), %%mm5 \n\t" //l4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
589 "movq (%0, %1, 4), %%mm4 \n\t" //l4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
590 "psubusb %%mm6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
591 "psubusb %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
592 "por %%mm6, %%mm5 \n\t" // |l3-l4| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
593 "pcmpeqb %%mm7, %%mm6 \n\t" // SIGN(l3-l4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
594 "pxor %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
595 "pand %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
596 PMINUB(%%mm5, %%mm3, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
597 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
598 "psubusb "MANGLE(b01)", %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
599 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
600 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
601 "movq (%%"REG_a", %1, 2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
602 "movq (%0, %1, 4), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
603 "pxor %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
604 "pxor %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
605 "psubb %%mm3, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
606 "paddb %%mm3, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
607 "pxor %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
608 "pxor %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
609 "movq %%mm0, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
610 "movq %%mm2, (%0, %1, 4) \n\t" |
0 | 611 #endif //0 |
612 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
613 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
614 "pcmpeqb %%mm6, %%mm6 \n\t" // -1 |
0 | 615 // 0 1 2 3 4 5 6 7 |
616 // %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 ecx+%1 ecx+2%1 | |
617 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 | |
618 | |
619 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
620 "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
|
621 "movq (%0, %1, 4), %%mm0 \n\t" // l4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
622 "pxor %%mm6, %%mm1 \n\t" // -l3-1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
623 PAVGB(%%mm1, %%mm0) // -q+128 = (l4-l3+256)/2 |
0 | 624 // mm1=-l3-1, mm0=128-q |
625 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
626 "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
|
627 "movq (%%"REG_a", %1), %%mm3 \n\t" // l2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
628 "pxor %%mm6, %%mm2 \n\t" // -l5-1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
629 "movq %%mm2, %%mm5 \n\t" // -l5-1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
630 "movq "MANGLE(b80)", %%mm4 \n\t" // 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
631 "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
|
632 PAVGB(%%mm3, %%mm2) // (l2-l5+256)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
633 PAVGB(%%mm0, %%mm4) // ~(l4-l3)/4 + 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
634 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
|
635 PAVGB(%%mm0, %%mm4) // ~(l2-l5)/8 +5(l4-l3)/16 + 128 |
0 | 636 // mm1=-l3-1, mm0=128-q, mm3=l2, mm4=menergy/16 + 128, mm5= -l5-1 |
637 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
638 "movq (%%"REG_a"), %%mm2 \n\t" // l1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
639 "pxor %%mm6, %%mm2 \n\t" // -l1-1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
640 PAVGB(%%mm3, %%mm2) // (l2-l1+256)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
641 PAVGB((%0), %%mm1) // (l0-l3+256)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
642 "movq "MANGLE(b80)", %%mm3 \n\t" // 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
643 PAVGB(%%mm2, %%mm3) // ~(l2-l1)/4 + 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
644 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
|
645 PAVGB(%%mm2, %%mm3) // ~(l0-l3)/8 +5(l2-l1)/16 + 128 |
0 | 646 // mm0=128-q, mm3=lenergy/16 + 128, mm4= menergy/16 + 128, mm5= -l5-1 |
647 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
648 PAVGB((%%REGc, %1), %%mm5) // (l6-l5+256)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
649 "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
|
650 "pxor %%mm6, %%mm1 \n\t" // -l7-1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
651 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
|
652 "movq "MANGLE(b80)", %%mm2 \n\t" // 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
653 PAVGB(%%mm5, %%mm2) // ~(l6-l5)/4 + 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
654 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
|
655 PAVGB(%%mm5, %%mm2) // ~(l4-l7)/8 +5(l6-l5)/16 + 128 |
0 | 656 // mm0=128-q, mm2=renergy/16 + 128, mm3=lenergy/16 + 128, mm4= menergy/16 + 128 |
657 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
658 "movq "MANGLE(b00)", %%mm1 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
659 "movq "MANGLE(b00)", %%mm5 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
660 "psubb %%mm2, %%mm1 \n\t" // 128 - renergy/16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
661 "psubb %%mm3, %%mm5 \n\t" // 128 - lenergy/16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
662 PMAXUB(%%mm1, %%mm2) // 128 + |renergy/16| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
663 PMAXUB(%%mm5, %%mm3) // 128 + |lenergy/16| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
664 PMINUB(%%mm2, %%mm3, %%mm1) // 128 + MIN(|lenergy|,|renergy|)/16 |
0 | 665 |
666 // mm0=128-q, mm3=128 + MIN(|lenergy|,|renergy|)/16, mm4= menergy/16 + 128 | |
667 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
668 "movq "MANGLE(b00)", %%mm7 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
669 "movq %2, %%mm2 \n\t" // QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
670 PAVGB(%%mm6, %%mm2) // 128 + QP/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
671 "psubb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
672 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
673 "movq %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
674 "pcmpgtb %%mm7, %%mm1 \n\t" // SIGN(menergy) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
675 "pxor %%mm1, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
676 "psubb %%mm1, %%mm4 \n\t" // 128 + |menergy|/16 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
677 "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
|
678 "psubusb %%mm3, %%mm4 \n\t" //d=|menergy|/16 - MIN(|lenergy|,|renergy|)/16 |
0 | 679 // mm0=128-q, mm1= SIGN(menergy), mm2= |menergy|/16 < QP/2, mm4= d/16 |
680 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
681 "movq %%mm4, %%mm3 \n\t" // d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
682 "psubusb "MANGLE(b01)", %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
683 PAVGB(%%mm7, %%mm4) // d/32 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
684 PAVGB(%%mm7, %%mm4) // (d + 32)/64 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
685 "paddb %%mm3, %%mm4 \n\t" // 5d/64 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
686 "pand %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
687 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
688 "movq "MANGLE(b80)", %%mm5 \n\t" // 128 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
689 "psubb %%mm0, %%mm5 \n\t" // q |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
690 "paddsb %%mm6, %%mm5 \n\t" // fix bad rounding |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
691 "pcmpgtb %%mm5, %%mm7 \n\t" // SIGN(q) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
692 "pxor %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
693 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
694 PMINUB(%%mm5, %%mm4, %%mm3) // MIN(|q|, 5d/64) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
695 "pxor %%mm1, %%mm7 \n\t" // SIGN(d*q) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
696 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
697 "pand %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
698 "movq (%%"REG_a", %1, 2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
699 "movq (%0, %1, 4), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
700 "pxor %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
701 "pxor %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
702 "paddb %%mm4, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
703 "psubb %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
704 "pxor %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
705 "pxor %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
706 "movq %%mm0, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
707 "movq %%mm2, (%0, %1, 4) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
708 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
709 : |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
710 : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
711 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
712 ); |
0 | 713 |
714 /* | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
715 { |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
716 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
717 src-= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
718 for(x=0; x<BLOCK_SIZE; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
719 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
|
720 if(FFABS(middleEnergy)< 8*QP){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
721 const int q=(src[l4] - src[l5])/2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
722 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
|
723 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
|
724 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
725 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
|
726 d= FFMAX(d, 0); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
727 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
728 d= (5*d + 32) >> 6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
729 d*= FFSIGN(-middleEnergy); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
730 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
731 if(q>0){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
732 d= d<0 ? 0 : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
733 d= d>q ? q : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
734 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
735 d= d>0 ? 0 : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
736 d= d<q ? q : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
737 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
738 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
739 src[l4]-= d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
740 src[l5]+= d; |
0 | 741 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
742 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
743 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
744 src-=8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
745 for(x=0; x<8; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
746 int y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
747 for(y=4; y<6; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
748 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
|
749 int ad= FFABS(d); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
750 static int max=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
751 static int sum=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
752 static int num=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
753 static int bias=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
754 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
755 if(max<ad) max=ad; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
756 sum+= ad>3 ? 1 : 0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
757 if(ad>3){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
758 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
|
759 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
760 if(y==4) bias+=d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
761 num++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
762 if(num%1000000 == 0){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
763 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
|
764 } |
0 | 765 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
766 } |
0 | 767 } |
768 */ | |
118 | 769 #elif HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
770 src+= stride*4; |
112 | 771 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
772 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
773 "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
|
774 "and "ALIGN_MASK", %%"REG_c" \n\t" // align |
0 | 775 // 0 1 2 3 4 5 6 7 |
776 // %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 edx+%1 edx+2%1 | |
777 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 | |
778 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
779 "movq (%0), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
780 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
781 "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
|
782 "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
|
783 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
784 "movq (%0, %1), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
785 "lea (%0, %1, 2), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
786 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
787 "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
|
788 "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
|
789 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
790 "movq (%%"REG_a"), %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
791 "movq %%mm4, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
792 "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
|
793 "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
|
794 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
795 "paddw %%mm0, %%mm0 \n\t" // 2L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
796 "paddw %%mm1, %%mm1 \n\t" // 2H0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
797 "psubw %%mm4, %%mm2 \n\t" // L1 - L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
798 "psubw %%mm5, %%mm3 \n\t" // H1 - H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
799 "psubw %%mm2, %%mm0 \n\t" // 2L0 - L1 + L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
800 "psubw %%mm3, %%mm1 \n\t" // 2H0 - H1 + H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
801 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
802 "psllw $2, %%mm2 \n\t" // 4L1 - 4L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
803 "psllw $2, %%mm3 \n\t" // 4H1 - 4H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
804 "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
805 "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
806 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
807 "movq (%%"REG_a", %1), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
808 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
809 "punpcklbw %%mm7, %%mm2 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
810 "punpckhbw %%mm7, %%mm3 \n\t" // H3 |
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 "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
|
813 "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
|
814 "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
|
815 "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
|
816 "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
|
817 "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
|
818 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
819 "movq (%%"REG_a", %1, 2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
820 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
821 "punpcklbw %%mm7, %%mm0 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
822 "punpckhbw %%mm7, %%mm1 \n\t" // H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
823 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
824 "psubw %%mm0, %%mm2 \n\t" // L3 - L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
825 "psubw %%mm1, %%mm3 \n\t" // H3 - H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
826 "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
|
827 "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
|
828 "paddw %%mm4, %%mm4 \n\t" // 2L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
829 "paddw %%mm5, %%mm5 \n\t" // 2H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
830 "psubw %%mm2, %%mm4 \n\t" // 2L2 - L3 + L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
831 "psubw %%mm3, %%mm5 \n\t" // 2H2 - H3 + H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
832 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
833 "lea (%%"REG_a", %1), %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
834 "psllw $2, %%mm2 \n\t" // 4L3 - 4L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
835 "psllw $2, %%mm3 \n\t" // 4H3 - 4H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
836 "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
837 "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 |
0 | 838 //50 opcodes so far |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
839 "movq (%0, %1, 2), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
840 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
841 "punpcklbw %%mm7, %%mm2 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
842 "punpckhbw %%mm7, %%mm3 \n\t" // H5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
843 "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
|
844 "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
|
845 "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
|
846 "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
|
847 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
848 "movq (%%"REG_a", %1, 4), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
849 "punpcklbw %%mm7, %%mm6 \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
850 "psubw %%mm6, %%mm2 \n\t" // L5 - L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
851 "movq (%%"REG_a", %1, 4), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
852 "punpckhbw %%mm7, %%mm6 \n\t" // H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
853 "psubw %%mm6, %%mm3 \n\t" // H5 - H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
854 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
855 "paddw %%mm0, %%mm0 \n\t" // 2L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
856 "paddw %%mm1, %%mm1 \n\t" // 2H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
857 "psubw %%mm2, %%mm0 \n\t" // 2L4 - L5 + L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
858 "psubw %%mm3, %%mm1 \n\t" // 2H4 - H5 + H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
859 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
860 "psllw $2, %%mm2 \n\t" // 4L5 - 4L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
861 "psllw $2, %%mm3 \n\t" // 4H5 - 4H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
862 "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
863 "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
864 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
865 "movq (%0, %1, 4), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
866 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
867 "punpcklbw %%mm7, %%mm2 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
868 "punpckhbw %%mm7, %%mm3 \n\t" // H7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
869 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
870 "paddw %%mm2, %%mm2 \n\t" // 2L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
871 "paddw %%mm3, %%mm3 \n\t" // 2H7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
872 "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
|
873 "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
|
874 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
875 "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
|
876 "movq 8(%%"REG_c"), %%mm3 \n\t" // 2H0 - 5H1 + 5H2 - 2H3 |
0 | 877 |
118 | 878 #if HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
879 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
880 "psubw %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
881 "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
|
882 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
883 "psubw %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
884 "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
|
885 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
886 "psubw %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
887 "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
|
888 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
889 "psubw %%mm3, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
890 "pmaxsw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| |
0 | 891 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
892 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
893 "pcmpgtw %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
894 "pxor %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
895 "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
|
896 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
897 "pcmpgtw %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
898 "pxor %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
899 "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
|
900 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
901 "pcmpgtw %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
902 "pxor %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
903 "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
|
904 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
905 "pcmpgtw %%mm3, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
906 "pxor %%mm6, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
907 "psubw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| |
0 | 908 #endif |
909 | |
118 | 910 #if HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
911 "pminsw %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
912 "pminsw %%mm3, %%mm1 \n\t" |
0 | 913 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
914 "movq %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
915 "psubusw %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
916 "psubw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
917 "movq %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
918 "psubusw %%mm3, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
919 "psubw %%mm6, %%mm1 \n\t" |
0 | 920 #endif |
921 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
922 "movd %2, %%mm2 \n\t" // QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
923 "punpcklbw %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
924 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
925 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
926 "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
|
927 "pxor %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
928 "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
|
929 "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
|
930 "pxor %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
931 "psubw %%mm7, %%mm5 \n\t" // |2H2 - 5H3 + 5H4 - 2H5| |
0 | 932 // 100 opcodes |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
933 "psllw $3, %%mm2 \n\t" // 8QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
934 "movq %%mm2, %%mm3 \n\t" // 8QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
935 "pcmpgtw %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
936 "pcmpgtw %%mm5, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
937 "pand %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
938 "pand %%mm3, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
939 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
940 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
941 "psubusw %%mm0, %%mm4 \n\t" // hd |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
942 "psubusw %%mm1, %%mm5 \n\t" // ld |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
943 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
944 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
945 "movq "MANGLE(w05)", %%mm2 \n\t" // 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
946 "pmullw %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
947 "pmullw %%mm2, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
948 "movq "MANGLE(w20)", %%mm2 \n\t" // 32 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
949 "paddw %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
950 "paddw %%mm2, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
951 "psrlw $6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
952 "psrlw $6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
953 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
954 "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
|
955 "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
|
956 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
957 "pxor %%mm2, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
958 "pxor %%mm3, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
959 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
960 "pcmpgtw %%mm0, %%mm2 \n\t" // sign (L3-L4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
961 "pcmpgtw %%mm1, %%mm3 \n\t" // sign (H3-H4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
962 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
963 "pxor %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
964 "psubw %%mm2, %%mm0 \n\t" // |L3-L4| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
965 "psubw %%mm3, %%mm1 \n\t" // |H3-H4| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
966 "psrlw $1, %%mm0 \n\t" // |L3 - L4|/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
967 "psrlw $1, %%mm1 \n\t" // |H3 - H4|/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
968 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
969 "pxor %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
970 "pxor %%mm7, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
971 "pand %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
972 "pand %%mm3, %%mm5 \n\t" |
0 | 973 |
118 | 974 #if HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
975 "pminsw %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
976 "pminsw %%mm1, %%mm5 \n\t" |
0 | 977 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
978 "movq %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
979 "psubusw %%mm0, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
980 "psubw %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
981 "movq %%mm5, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
982 "psubusw %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
983 "psubw %%mm2, %%mm5 \n\t" |
0 | 984 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
985 "pxor %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
986 "pxor %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
987 "psubw %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
988 "psubw %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
989 "packsswb %%mm5, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
990 "movq (%0), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
991 "paddb %%mm4, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
992 "movq %%mm0, (%0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
993 "movq (%0, %1), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
994 "psubb %%mm4, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
995 "movq %%mm0, (%0, %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
996 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
997 : "+r" (src) |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
998 : "r" ((x86_reg)stride), "m" (c->pQPb) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
999 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1000 ); |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1001 #else //HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1002 const int l1= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1003 const int l2= stride + l1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1004 const int l3= stride + l2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1005 const int l4= stride + l3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1006 const int l5= stride + l4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1007 const int l6= stride + l5; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1008 const int l7= stride + l6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1009 const int l8= stride + l7; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1010 // const int l9= stride + l8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1011 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1012 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1013 for(x=0; x<BLOCK_SIZE; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1014 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
|
1015 if(FFABS(middleEnergy) < 8*c->QP){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1016 const int q=(src[l4] - src[l5])/2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1017 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
|
1018 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
|
1019 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1020 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
|
1021 d= FFMAX(d, 0); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1022 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1023 d= (5*d + 32) >> 6; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1024 d*= FFSIGN(-middleEnergy); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1025 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1026 if(q>0){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1027 d= d<0 ? 0 : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1028 d= d>q ? q : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1029 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1030 d= d>0 ? 0 : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1031 d= d<q ? q : d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1032 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1033 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1034 src[l4]-= d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1035 src[l5]+= d; |
0 | 1036 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1037 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1038 } |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1039 #endif //HAVE_MMX2 || HAVE_AMD3DNOW |
0 | 1040 } |
1041 #endif //HAVE_ALTIVEC | |
1042 | |
118 | 1043 #if !HAVE_ALTIVEC |
0 | 1044 static inline void RENAME(dering)(uint8_t src[], int stride, PPContext *c) |
1045 { | |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1046 #if HAVE_MMX2 || HAVE_AMD3DNOW |
112 | 1047 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1048 "pxor %%mm6, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1049 "pcmpeqb %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1050 "movq %2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1051 "punpcklbw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1052 "psrlw $1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1053 "psubw %%mm7, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1054 "packuswb %%mm0, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1055 "movq %%mm0, %3 \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 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1058 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t" |
0 | 1059 |
1060 // 0 1 2 3 4 5 6 7 8 9 | |
1061 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 | |
1062 | |
134
ced16a4fbbec
Fix warnings about redefining constants when compiling libpostproc.
cehoyos
parents:
133
diff
changeset
|
1063 #undef REAL_FIND_MIN_MAX |
0 | 1064 #undef FIND_MIN_MAX |
118 | 1065 #if HAVE_MMX2 |
0 | 1066 #define REAL_FIND_MIN_MAX(addr)\ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1067 "movq " #addr ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1068 "pminub %%mm0, %%mm7 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1069 "pmaxub %%mm0, %%mm6 \n\t" |
0 | 1070 #else |
1071 #define REAL_FIND_MIN_MAX(addr)\ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1072 "movq " #addr ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1073 "movq %%mm7, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1074 "psubusb %%mm0, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1075 "paddb %%mm0, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1076 "psubusb %%mm0, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1077 "psubb %%mm1, %%mm7 \n\t" |
0 | 1078 #endif |
1079 #define FIND_MIN_MAX(addr) REAL_FIND_MIN_MAX(addr) | |
1080 | |
1081 FIND_MIN_MAX((%%REGa)) | |
1082 FIND_MIN_MAX((%%REGa, %1)) | |
1083 FIND_MIN_MAX((%%REGa, %1, 2)) | |
1084 FIND_MIN_MAX((%0, %1, 4)) | |
1085 FIND_MIN_MAX((%%REGd)) | |
1086 FIND_MIN_MAX((%%REGd, %1)) | |
1087 FIND_MIN_MAX((%%REGd, %1, 2)) | |
1088 FIND_MIN_MAX((%0, %1, 8)) | |
1089 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1090 "movq %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1091 "psrlq $8, %%mm7 \n\t" |
118 | 1092 #if HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1093 "pminub %%mm4, %%mm7 \n\t" // min of pixels |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1094 "pshufw $0xF9, %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1095 "pminub %%mm4, %%mm7 \n\t" // min of pixels |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1096 "pshufw $0xFE, %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1097 "pminub %%mm4, %%mm7 \n\t" |
0 | 1098 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1099 "movq %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1100 "psubusb %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1101 "psubb %%mm1, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1102 "movq %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1103 "psrlq $16, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1104 "movq %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1105 "psubusb %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1106 "psubb %%mm1, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1107 "movq %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1108 "psrlq $32, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1109 "movq %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1110 "psubusb %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1111 "psubb %%mm1, %%mm7 \n\t" |
0 | 1112 #endif |
1113 | |
1114 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1115 "movq %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1116 "psrlq $8, %%mm6 \n\t" |
118 | 1117 #if HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1118 "pmaxub %%mm4, %%mm6 \n\t" // max of pixels |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1119 "pshufw $0xF9, %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1120 "pmaxub %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1121 "pshufw $0xFE, %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1122 "pmaxub %%mm4, %%mm6 \n\t" |
0 | 1123 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1124 "psubusb %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1125 "paddb %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1126 "movq %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1127 "psrlq $16, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1128 "psubusb %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1129 "paddb %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1130 "movq %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1131 "psrlq $32, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1132 "psubusb %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1133 "paddb %%mm4, %%mm6 \n\t" |
0 | 1134 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1135 "movq %%mm6, %%mm0 \n\t" // max |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1136 "psubb %%mm7, %%mm6 \n\t" // max - min |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1137 "movd %%mm6, %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1138 "cmpb "MANGLE(deringThreshold)", %%cl \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1139 " jb 1f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1140 "lea -24(%%"REG_SP"), %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1141 "and "ALIGN_MASK", %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1142 PAVGB(%%mm0, %%mm7) // a=(max + min)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1143 "punpcklbw %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1144 "punpcklbw %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1145 "punpcklbw %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1146 "movq %%mm7, (%%"REG_c") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1147 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1148 "movq (%0), %%mm0 \n\t" // L10 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1149 "movq %%mm0, %%mm1 \n\t" // L10 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1150 "movq %%mm0, %%mm2 \n\t" // L10 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1151 "psllq $8, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1152 "psrlq $8, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1153 "movd -4(%0), %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1154 "movd 8(%0), %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1155 "psrlq $24, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1156 "psllq $56, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1157 "por %%mm3, %%mm1 \n\t" // L00 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1158 "por %%mm4, %%mm2 \n\t" // L20 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1159 "movq %%mm1, %%mm3 \n\t" // L00 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1160 PAVGB(%%mm2, %%mm1) // (L20 + L00)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1161 PAVGB(%%mm0, %%mm1) // (L20 + L00 + 2L10)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1162 "psubusb %%mm7, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1163 "psubusb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1164 "psubusb %%mm7, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1165 "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
|
1166 "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
|
1167 "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
|
1168 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1169 "paddb %%mm3, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1170 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1171 "movq (%%"REG_a"), %%mm2 \n\t" // L11 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1172 "movq %%mm2, %%mm3 \n\t" // L11 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1173 "movq %%mm2, %%mm4 \n\t" // L11 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1174 "psllq $8, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1175 "psrlq $8, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1176 "movd -4(%%"REG_a"), %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1177 "movd 8(%%"REG_a"), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1178 "psrlq $24, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1179 "psllq $56, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1180 "por %%mm5, %%mm3 \n\t" // L01 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1181 "por %%mm6, %%mm4 \n\t" // L21 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1182 "movq %%mm3, %%mm5 \n\t" // L01 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1183 PAVGB(%%mm4, %%mm3) // (L21 + L01)/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1184 PAVGB(%%mm2, %%mm3) // (L21 + L01 + 2L11)/4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1185 "psubusb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1186 "psubusb %%mm7, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1187 "psubusb %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1188 "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
|
1189 "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
|
1190 "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
|
1191 "paddb %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1192 "paddb %%mm5, %%mm2 \n\t" |
0 | 1193 // 0, 2, 3, 1 |
1194 #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
|
1195 "movq " #src ", " #sx " \n\t" /* src[0] */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1196 "movq " #sx ", " #lx " \n\t" /* src[0] */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1197 "movq " #sx ", " #t0 " \n\t" /* src[0] */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1198 "psllq $8, " #lx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1199 "psrlq $8, " #t0 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1200 "movd -4" #src ", " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1201 "psrlq $24, " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1202 "por " #t1 ", " #lx " \n\t" /* src[-1] */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1203 "movd 8" #src ", " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1204 "psllq $56, " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1205 "por " #t1 ", " #t0 " \n\t" /* src[+1] */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1206 "movq " #lx ", " #t1 " \n\t" /* src[-1] */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1207 PAVGB(t0, lx) /* (src[-1] + src[+1])/2 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1208 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
|
1209 PAVGB(lx, pplx) \ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1210 "movq " #lx ", 8(%%"REG_c") \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1211 "movq (%%"REG_c"), " #lx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1212 "psubusb " #lx ", " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1213 "psubusb " #lx ", " #t0 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1214 "psubusb " #lx ", " #sx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1215 "movq "MANGLE(b00)", " #lx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1216 "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
|
1217 "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
|
1218 "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
|
1219 "paddb " #t1 ", " #t0 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1220 "paddb " #t0 ", " #sx " \n\t"\ |
0 | 1221 \ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1222 PAVGB(plx, pplx) /* filtered */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1223 "movq " #dst ", " #t0 " \n\t" /* dst */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1224 "movq " #t0 ", " #t1 " \n\t" /* dst */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1225 "psubusb %3, " #t0 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1226 "paddusb %3, " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1227 PMAXUB(t0, pplx)\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1228 PMINUB(t1, pplx, t0)\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1229 "paddb " #sx ", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1230 "paddb " #psx ", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1231 "#paddb "MANGLE(b02)", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1232 "pand "MANGLE(b08)", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1233 "pcmpeqb " #lx ", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1234 "pand " #ppsx ", " #pplx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1235 "pandn " #dst ", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1236 "por " #pplx ", " #ppsx " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1237 "movq " #ppsx ", " #dst " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1238 "movq 8(%%"REG_c"), " #lx " \n\t" |
0 | 1239 |
1240 #define DERING_CORE(dst,src,ppsx,psx,sx,pplx,plx,lx,t0,t1) \ | |
1241 REAL_DERING_CORE(dst,src,ppsx,psx,sx,pplx,plx,lx,t0,t1) | |
1242 /* | |
1243 0000000 | |
1244 1111111 | |
1245 | |
1246 1111110 | |
1247 1111101 | |
1248 1111100 | |
1249 1111011 | |
1250 1111010 | |
1251 1111001 | |
1252 | |
1253 1111000 | |
1254 1110111 | |
1255 | |
1256 */ | |
1257 //DERING_CORE(dst ,src ,ppsx ,psx ,sx ,pplx ,plx ,lx ,t0 ,t1) | |
1258 DERING_CORE((%%REGa) ,(%%REGa, %1) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7) | |
1259 DERING_CORE((%%REGa, %1) ,(%%REGa, %1, 2),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7) | |
1260 DERING_CORE((%%REGa, %1, 2),(%0, %1, 4) ,%%mm4,%%mm0,%%mm2,%%mm5,%%mm1,%%mm3,%%mm6,%%mm7) | |
1261 DERING_CORE((%0, %1, 4) ,(%%REGd) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7) | |
1262 DERING_CORE((%%REGd) ,(%%REGd, %1) ,%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7) | |
1263 DERING_CORE((%%REGd, %1) ,(%%REGd, %1, 2),%%mm4,%%mm0,%%mm2,%%mm5,%%mm1,%%mm3,%%mm6,%%mm7) | |
1264 DERING_CORE((%%REGd, %1, 2),(%0, %1, 8) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7) | |
1265 DERING_CORE((%0, %1, 8) ,(%%REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7) | |
1266 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1267 "1: \n\t" |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
1268 : : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb), "m"(c->pQPb2) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1269 : "%"REG_a, "%"REG_d, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1270 ); |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1271 #else //HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1272 int y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1273 int min=255; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1274 int max=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1275 int avg; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1276 uint8_t *p; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1277 int s[10]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1278 const int QP2= c->QP/2 + 1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1279 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1280 for(y=1; y<9; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1281 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1282 p= src + stride*y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1283 for(x=1; x<9; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1284 p++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1285 if(*p > max) max= *p; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1286 if(*p < min) min= *p; |
0 | 1287 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1288 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1289 avg= (min + max + 1)>>1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1290 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1291 if(max - min <deringThreshold) return; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1292 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1293 for(y=0; y<10; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1294 int t = 0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1295 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1296 if(src[stride*y + 0] > avg) t+= 1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1297 if(src[stride*y + 1] > avg) t+= 2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1298 if(src[stride*y + 2] > avg) t+= 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1299 if(src[stride*y + 3] > avg) t+= 8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1300 if(src[stride*y + 4] > avg) t+= 16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1301 if(src[stride*y + 5] > avg) t+= 32; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1302 if(src[stride*y + 6] > avg) t+= 64; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1303 if(src[stride*y + 7] > avg) t+= 128; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1304 if(src[stride*y + 8] > avg) t+= 256; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1305 if(src[stride*y + 9] > avg) t+= 512; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1306 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1307 t |= (~t)<<16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1308 t &= (t<<1) & (t>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1309 s[y] = t; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1310 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1311 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1312 for(y=1; y<9; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1313 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
|
1314 t|= t>>16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1315 s[y-1]= t; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1316 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1317 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1318 for(y=1; y<9; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1319 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1320 int t = s[y-1]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1321 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1322 p= src + stride*y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1323 for(x=1; x<9; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1324 p++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1325 if(t & (1<<x)){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1326 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
|
1327 +2*(*(p -1)) + 4*(*p ) + 2*(*(p +1)) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1328 +(*(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
|
1329 f= (f + 8)>>4; |
0 | 1330 |
1331 #ifdef DEBUG_DERING_THRESHOLD | |
112 | 1332 __asm__ volatile("emms\n\t":); |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1333 { |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1334 static long long numPixels=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1335 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
|
1336 // if((max-min)<20 || (max-min)*QP<200) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1337 // if((max-min)*QP < 500) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1338 // if(max-min<QP/2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1339 if(max-min < 20){ |
96
404a656698ff
cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents:
95
diff
changeset
|
1340 static int numSkipped=0; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1341 static int errorSum=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1342 static int worstQP=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1343 static int worstRange=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1344 static int worstDiff=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1345 int diff= (f - *p); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1346 int absDiff= FFABS(diff); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1347 int error= diff*diff; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1348 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1349 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
|
1350 |
96
404a656698ff
cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents:
95
diff
changeset
|
1351 numSkipped++; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1352 if(absDiff > worstDiff){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1353 worstDiff= absDiff; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1354 worstQP= QP; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1355 worstRange= max-min; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1356 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1357 errorSum+= error; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1358 |
96
404a656698ff
cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents:
95
diff
changeset
|
1359 if(1024LL*1024LL*1024LL % numSkipped == 0){ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1360 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
|
1361 "wRange:%d, wDiff:%d, relSkip:%1.3f\n", |
96
404a656698ff
cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents:
95
diff
changeset
|
1362 (float)errorSum/numSkipped, numSkipped, worstQP, worstRange, |
404a656698ff
cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents:
95
diff
changeset
|
1363 worstDiff, (float)numSkipped/numPixels); |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1364 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1365 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1366 } |
0 | 1367 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1368 if (*p + QP2 < f) *p= *p + QP2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1369 else if(*p - QP2 > f) *p= *p - QP2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1370 else *p=f; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1371 } |
0 | 1372 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1373 } |
0 | 1374 #ifdef DEBUG_DERING_THRESHOLD |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1375 if(max-min < 20){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1376 for(y=1; y<9; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1377 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1378 int t = 0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1379 p= src + stride*y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1380 for(x=1; x<9; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1381 p++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1382 *p = FFMIN(*p + 20, 255); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1383 } |
0 | 1384 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1385 // 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
|
1386 } |
0 | 1387 #endif |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1388 #endif //HAVE_MMX2 || HAVE_AMD3DNOW |
0 | 1389 } |
1390 #endif //HAVE_ALTIVEC | |
1391 | |
1392 /** | |
136 | 1393 * Deinterlace the given block by linearly interpolating every second line. |
0 | 1394 * will be called for every 8x8 block and can read & write from line 4-15 |
90 | 1395 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too. |
0 | 1396 * lines 4-12 will be read into the deblocking filter and should be deinterlaced |
1397 */ | |
1398 static inline void RENAME(deInterlaceInterpolateLinear)(uint8_t src[], int stride) | |
1399 { | |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1400 #if HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1401 src+= 4*stride; |
112 | 1402 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1403 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1404 "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t" |
0 | 1405 // 0 1 2 3 4 5 6 7 8 9 |
1406 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %0+8%1 ecx+4%1 | |
1407 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1408 "movq (%0), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1409 "movq (%%"REG_a", %1), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1410 PAVGB(%%mm1, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1411 "movq %%mm0, (%%"REG_a") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1412 "movq (%0, %1, 4), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1413 PAVGB(%%mm0, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1414 "movq %%mm1, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1415 "movq (%%"REG_c", %1), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1416 PAVGB(%%mm1, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1417 "movq %%mm0, (%%"REG_c") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1418 "movq (%0, %1, 8), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1419 PAVGB(%%mm0, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1420 "movq %%mm1, (%%"REG_c", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1421 |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
1422 : : "r" (src), "r" ((x86_reg)stride) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1423 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1424 ); |
0 | 1425 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1426 int a, b, x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1427 src+= 4*stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1428 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1429 for(x=0; x<2; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1430 a= *(uint32_t*)&src[stride*0]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1431 b= *(uint32_t*)&src[stride*2]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1432 *(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
|
1433 a= *(uint32_t*)&src[stride*4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1434 *(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
|
1435 b= *(uint32_t*)&src[stride*6]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1436 *(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
|
1437 a= *(uint32_t*)&src[stride*8]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1438 *(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
|
1439 src += 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1440 } |
0 | 1441 #endif |
1442 } | |
1443 | |
1444 /** | |
136 | 1445 * Deinterlace the given block by cubic interpolating every second line. |
0 | 1446 * will be called for every 8x8 block and can read & write from line 4-15 |
90 | 1447 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too. |
0 | 1448 * lines 4-12 will be read into the deblocking filter and should be deinterlaced |
1449 * this filter will read lines 3-15 and write 7-13 | |
1450 */ | |
1451 static inline void RENAME(deInterlaceInterpolateCubic)(uint8_t src[], int stride) | |
1452 { | |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1453 #if HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1454 src+= stride*3; |
112 | 1455 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1456 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1457 "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
|
1458 "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
|
1459 "add %1, %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1460 "pxor %%mm7, %%mm7 \n\t" |
0 | 1461 // 0 1 2 3 4 5 6 7 8 9 10 |
1462 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx | |
1463 | |
1464 #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
|
1465 "movq " #a ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1466 "movq " #b ", %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1467 "movq " #d ", %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1468 "movq " #e ", %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1469 PAVGB(%%mm2, %%mm1) /* (b+d) /2 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1470 PAVGB(%%mm3, %%mm0) /* a(a+e) /2 */\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1471 "movq %%mm0, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1472 "punpcklbw %%mm7, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1473 "punpckhbw %%mm7, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1474 "movq %%mm1, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1475 "punpcklbw %%mm7, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1476 "punpckhbw %%mm7, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1477 "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
|
1478 "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
|
1479 "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
|
1480 "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
|
1481 "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
|
1482 "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
|
1483 "packuswb %%mm3, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1484 "movq %%mm1, " #c " \n\t" |
0 | 1485 #define DEINT_CUBIC(a,b,c,d,e) REAL_DEINT_CUBIC(a,b,c,d,e) |
1486 | |
1487 DEINT_CUBIC((%0) , (%%REGa, %1), (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd, %1)) | |
1488 DEINT_CUBIC((%%REGa, %1), (%0, %1, 4) , (%%REGd) , (%%REGd, %1), (%0, %1, 8)) | |
1489 DEINT_CUBIC((%0, %1, 4) , (%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8) , (%%REGc)) | |
1490 DEINT_CUBIC((%%REGd, %1), (%0, %1, 8) , (%%REGd, %1, 4), (%%REGc) , (%%REGc, %1, 2)) | |
1491 | |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
1492 : : "r" (src), "r" ((x86_reg)stride) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1493 : "%"REG_a, "%"REG_d, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1494 ); |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1495 #else //HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1496 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1497 src+= stride*3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1498 for(x=0; x<8; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1499 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
|
1500 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
|
1501 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
|
1502 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
|
1503 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1504 } |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1505 #endif //HAVE_MMX2 || HAVE_AMD3DNOW |
0 | 1506 } |
1507 | |
1508 /** | |
136 | 1509 * Deinterlace the given block by filtering every second line with a (-1 4 2 4 -1) filter. |
0 | 1510 * will be called for every 8x8 block and can read & write from line 4-15 |
90 | 1511 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too. |
0 | 1512 * lines 4-12 will be read into the deblocking filter and should be deinterlaced |
1513 * this filter will read lines 4-13 and write 5-11 | |
1514 */ | |
1515 static inline void RENAME(deInterlaceFF)(uint8_t src[], int stride, uint8_t *tmp) | |
1516 { | |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1517 #if HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1518 src+= stride*4; |
112 | 1519 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1520 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1521 "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
|
1522 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1523 "movq (%2), %%mm0 \n\t" |
0 | 1524 // 0 1 2 3 4 5 6 7 8 9 10 |
1525 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx | |
1526 | |
1527 #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
|
1528 "movq " #a ", %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1529 "movq " #b ", %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1530 "movq " #c ", %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1531 "movq " #d ", %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1532 PAVGB(%%mm3, %%mm1) \ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1533 PAVGB(%%mm4, %%mm0) \ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1534 "movq %%mm0, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1535 "punpcklbw %%mm7, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1536 "punpckhbw %%mm7, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1537 "movq %%mm1, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1538 "punpcklbw %%mm7, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1539 "punpckhbw %%mm7, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1540 "psllw $2, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1541 "psllw $2, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1542 "psubw %%mm0, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1543 "psubw %%mm3, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1544 "movq %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1545 "movq %%mm2, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1546 "punpcklbw %%mm7, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1547 "punpckhbw %%mm7, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1548 "paddw %%mm2, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1549 "paddw %%mm5, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1550 "psraw $2, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1551 "psraw $2, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1552 "packuswb %%mm4, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1553 "movq %%mm1, " #b " \n\t"\ |
0 | 1554 |
1555 #define DEINT_FF(a,b,c,d) REAL_DEINT_FF(a,b,c,d) | |
1556 | |
1557 DEINT_FF((%0) , (%%REGa) , (%%REGa, %1), (%%REGa, %1, 2)) | |
1558 DEINT_FF((%%REGa, %1), (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd) ) | |
1559 DEINT_FF((%0, %1, 4) , (%%REGd) , (%%REGd, %1), (%%REGd, %1, 2)) | |
1560 DEINT_FF((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4)) | |
1561 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1562 "movq %%mm0, (%2) \n\t" |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
1563 : : "r" (src), "r" ((x86_reg)stride), "r"(tmp) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1564 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1565 ); |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1566 #else //HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1567 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1568 src+= stride*4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1569 for(x=0; x<8; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1570 int t1= tmp[x]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1571 int t2= src[stride*1]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1572 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1573 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
|
1574 t1= src[stride*4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1575 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
|
1576 t2= src[stride*6]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1577 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
|
1578 t1= src[stride*8]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1579 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
|
1580 tmp[x]= t1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1581 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1582 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1583 } |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1584 #endif //HAVE_MMX2 || HAVE_AMD3DNOW |
0 | 1585 } |
1586 | |
1587 /** | |
136 | 1588 * Deinterlace the given block by filtering every line with a (-1 2 6 2 -1) filter. |
0 | 1589 * will be called for every 8x8 block and can read & write from line 4-15 |
90 | 1590 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too. |
0 | 1591 * lines 4-12 will be read into the deblocking filter and should be deinterlaced |
1592 * this filter will read lines 4-13 and write 4-11 | |
1593 */ | |
1594 static inline void RENAME(deInterlaceL5)(uint8_t src[], int stride, uint8_t *tmp, uint8_t *tmp2) | |
1595 { | |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1596 #if HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1597 src+= stride*4; |
112 | 1598 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1599 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1600 "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
|
1601 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1602 "movq (%2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1603 "movq (%3), %%mm1 \n\t" |
0 | 1604 // 0 1 2 3 4 5 6 7 8 9 10 |
1605 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx | |
1606 | |
1607 #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
|
1608 "movq " #a ", %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1609 "movq " #b ", %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1610 "movq " #c ", %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1611 PAVGB(t2, %%mm3) \ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1612 PAVGB(t1, %%mm4) \ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1613 "movq %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1614 "movq %%mm2, " #t1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1615 "punpcklbw %%mm7, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1616 "punpckhbw %%mm7, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1617 "movq %%mm2, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1618 "paddw %%mm2, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1619 "paddw %%mm6, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1620 "movq %%mm5, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1621 "paddw %%mm5, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1622 "paddw %%mm6, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1623 "movq %%mm3, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1624 "punpcklbw %%mm7, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1625 "punpckhbw %%mm7, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1626 "paddw %%mm3, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1627 "paddw %%mm6, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1628 "paddw %%mm3, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1629 "paddw %%mm6, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1630 "movq %%mm4, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1631 "punpcklbw %%mm7, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1632 "punpckhbw %%mm7, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1633 "psubw %%mm4, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1634 "psubw %%mm6, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1635 "psraw $2, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1636 "psraw $2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1637 "packuswb %%mm5, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1638 "movq %%mm2, " #a " \n\t"\ |
0 | 1639 |
1640 #define DEINT_L5(t1,t2,a,b,c) REAL_DEINT_L5(t1,t2,a,b,c) | |
1641 | |
1642 DEINT_L5(%%mm0, %%mm1, (%0) , (%%REGa) , (%%REGa, %1) ) | |
1643 DEINT_L5(%%mm1, %%mm0, (%%REGa) , (%%REGa, %1) , (%%REGa, %1, 2)) | |
1644 DEINT_L5(%%mm0, %%mm1, (%%REGa, %1) , (%%REGa, %1, 2), (%0, %1, 4) ) | |
1645 DEINT_L5(%%mm1, %%mm0, (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd) ) | |
1646 DEINT_L5(%%mm0, %%mm1, (%0, %1, 4) , (%%REGd) , (%%REGd, %1) ) | |
1647 DEINT_L5(%%mm1, %%mm0, (%%REGd) , (%%REGd, %1) , (%%REGd, %1, 2)) | |
1648 DEINT_L5(%%mm0, %%mm1, (%%REGd, %1) , (%%REGd, %1, 2), (%0, %1, 8) ) | |
1649 DEINT_L5(%%mm1, %%mm0, (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4)) | |
1650 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1651 "movq %%mm0, (%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1652 "movq %%mm1, (%3) \n\t" |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
1653 : : "r" (src), "r" ((x86_reg)stride), "r"(tmp), "r"(tmp2) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1654 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1655 ); |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1656 #else //HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1657 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1658 src+= stride*4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1659 for(x=0; x<8; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1660 int t1= tmp[x]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1661 int t2= tmp2[x]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1662 int t3= src[0]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1663 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1664 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
|
1665 t1= src[stride*1]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1666 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
|
1667 t2= src[stride*2]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1668 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
|
1669 t3= src[stride*3]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1670 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
|
1671 t1= src[stride*4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1672 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
|
1673 t2= src[stride*5]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1674 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
|
1675 t3= src[stride*6]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1676 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
|
1677 t1= src[stride*7]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1678 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
|
1679 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1680 tmp[x]= t3; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1681 tmp2[x]= t1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1682 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1683 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1684 } |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1685 #endif //HAVE_MMX2 || HAVE_AMD3DNOW |
0 | 1686 } |
1687 | |
1688 /** | |
136 | 1689 * Deinterlace the given block by filtering all lines with a (1 2 1) filter. |
0 | 1690 * will be called for every 8x8 block and can read & write from line 4-15 |
90 | 1691 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too. |
0 | 1692 * lines 4-12 will be read into the deblocking filter and should be deinterlaced |
1693 * this filter will read lines 4-13 and write 4-11 | |
1694 */ | |
1695 static inline void RENAME(deInterlaceBlendLinear)(uint8_t src[], int stride, uint8_t *tmp) | |
1696 { | |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1697 #if HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1698 src+= 4*stride; |
112 | 1699 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1700 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1701 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t" |
0 | 1702 // 0 1 2 3 4 5 6 7 8 9 |
1703 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 | |
1704 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1705 "movq (%2), %%mm0 \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1706 "movq (%%"REG_a"), %%mm1 \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1707 PAVGB(%%mm1, %%mm0) // L0+L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1708 "movq (%0), %%mm2 \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1709 PAVGB(%%mm2, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1710 "movq %%mm0, (%0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1711 "movq (%%"REG_a", %1), %%mm0 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1712 PAVGB(%%mm0, %%mm2) // L1+L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1713 PAVGB(%%mm1, %%mm2) // 2L2 + L1 + L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1714 "movq %%mm2, (%%"REG_a") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1715 "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
|
1716 PAVGB(%%mm2, %%mm1) // L2+L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1717 PAVGB(%%mm0, %%mm1) // 2L3 + L2 + L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1718 "movq %%mm1, (%%"REG_a", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1719 "movq (%0, %1, 4), %%mm1 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1720 PAVGB(%%mm1, %%mm0) // L3+L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1721 PAVGB(%%mm2, %%mm0) // 2L4 + L3 + L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1722 "movq %%mm0, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1723 "movq (%%"REG_d"), %%mm0 \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1724 PAVGB(%%mm0, %%mm2) // L4+L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1725 PAVGB(%%mm1, %%mm2) // 2L5 + L4 + L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1726 "movq %%mm2, (%0, %1, 4) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1727 "movq (%%"REG_d", %1), %%mm2 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1728 PAVGB(%%mm2, %%mm1) // L5+L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1729 PAVGB(%%mm0, %%mm1) // 2L6 + L5 + L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1730 "movq %%mm1, (%%"REG_d") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1731 "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
|
1732 PAVGB(%%mm1, %%mm0) // L6+L8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1733 PAVGB(%%mm2, %%mm0) // 2L7 + L6 + L8 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1734 "movq %%mm0, (%%"REG_d", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1735 "movq (%0, %1, 8), %%mm0 \n\t" // L9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1736 PAVGB(%%mm0, %%mm2) // L7+L9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1737 PAVGB(%%mm1, %%mm2) // 2L8 + L7 + L9 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1738 "movq %%mm2, (%%"REG_d", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1739 "movq %%mm1, (%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1740 |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
1741 : : "r" (src), "r" ((x86_reg)stride), "r" (tmp) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1742 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1743 ); |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1744 #else //HAVE_MMX2 || HAVE_AMD3DNOW |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1745 int a, b, c, x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1746 src+= 4*stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1747 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1748 for(x=0; x<2; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1749 a= *(uint32_t*)&tmp[stride*0]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1750 b= *(uint32_t*)&src[stride*0]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1751 c= *(uint32_t*)&src[stride*1]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1752 a= (a&c) + (((a^c)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1753 *(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
|
1754 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1755 a= *(uint32_t*)&src[stride*2]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1756 b= (a&b) + (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1757 *(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
|
1758 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1759 b= *(uint32_t*)&src[stride*3]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1760 c= (b&c) + (((b^c)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1761 *(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
|
1762 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1763 c= *(uint32_t*)&src[stride*4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1764 a= (a&c) + (((a^c)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1765 *(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
|
1766 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1767 a= *(uint32_t*)&src[stride*5]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1768 b= (a&b) + (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1769 *(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
|
1770 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1771 b= *(uint32_t*)&src[stride*6]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1772 c= (b&c) + (((b^c)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1773 *(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
|
1774 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1775 c= *(uint32_t*)&src[stride*7]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1776 a= (a&c) + (((a^c)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1777 *(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
|
1778 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1779 a= *(uint32_t*)&src[stride*8]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1780 b= (a&b) + (((a^b)&0xFEFEFEFEUL)>>1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1781 *(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
|
1782 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1783 *(uint32_t*)&tmp[stride*0]= c; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1784 src += 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1785 tmp += 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1786 } |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
1787 #endif //HAVE_MMX2 || HAVE_AMD3DNOW |
0 | 1788 } |
1789 | |
1790 /** | |
136 | 1791 * Deinterlace the given block by applying a median filter to every second line. |
0 | 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 */ | |
1796 static inline void RENAME(deInterlaceMedian)(uint8_t src[], int stride) | |
1797 { | |
119 | 1798 #if HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1799 src+= 4*stride; |
118 | 1800 #if HAVE_MMX2 |
112 | 1801 __asm__ volatile( |
95
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 (%0), %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1808 "movq (%%"REG_a", %1), %%mm2 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1809 "movq (%%"REG_a"), %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1810 "movq %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1811 "pmaxub %%mm1, %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1812 "pminub %%mm3, %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1813 "pmaxub %%mm2, %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1814 "pminub %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1815 "movq %%mm0, (%%"REG_a") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1816 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1817 "movq (%0, %1, 4), %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1818 "movq (%%"REG_a", %1, 2), %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1819 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1820 "pmaxub %%mm1, %%mm2 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1821 "pminub %%mm3, %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1822 "pmaxub %%mm0, %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1823 "pminub %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1824 "movq %%mm2, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1825 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1826 "movq (%%"REG_d"), %%mm2 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1827 "movq (%%"REG_d", %1), %%mm1 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1828 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1829 "pmaxub %%mm0, %%mm2 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1830 "pminub %%mm3, %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1831 "pmaxub %%mm1, %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1832 "pminub %%mm0, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1833 "movq %%mm2, (%%"REG_d") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1834 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1835 "movq (%%"REG_d", %1, 2), %%mm2 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1836 "movq (%0, %1, 8), %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1837 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1838 "pmaxub %%mm0, %%mm2 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1839 "pminub %%mm3, %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1840 "pmaxub %%mm1, %%mm0 \n\t" // |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1841 "pminub %%mm0, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1842 "movq %%mm2, (%%"REG_d", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1843 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1844 |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
1845 : : "r" (src), "r" ((x86_reg)stride) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1846 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1847 ); |
0 | 1848 |
1849 #else // MMX without MMX2 | |
112 | 1850 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1851 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1852 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t" |
0 | 1853 // 0 1 2 3 4 5 6 7 8 9 |
1854 // %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
|
1855 "pxor %%mm7, %%mm7 \n\t" |
0 | 1856 |
1857 #define REAL_MEDIAN(a,b,c)\ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1858 "movq " #a ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1859 "movq " #b ", %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1860 "movq " #c ", %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1861 "movq %%mm0, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1862 "movq %%mm1, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1863 "movq %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1864 "psubusb %%mm1, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1865 "psubusb %%mm2, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1866 "psubusb %%mm0, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1867 "pcmpeqb %%mm7, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1868 "pcmpeqb %%mm7, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1869 "pcmpeqb %%mm7, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1870 "movq %%mm3, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1871 "pxor %%mm4, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1872 "pxor %%mm5, %%mm4 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1873 "pxor %%mm6, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1874 "por %%mm3, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1875 "por %%mm4, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1876 "por %%mm5, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1877 "pand %%mm2, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1878 "pand %%mm1, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1879 "movq %%mm0, " #b " \n\t" |
0 | 1880 #define MEDIAN(a,b,c) REAL_MEDIAN(a,b,c) |
1881 | |
1882 MEDIAN((%0) , (%%REGa) , (%%REGa, %1)) | |
1883 MEDIAN((%%REGa, %1), (%%REGa, %1, 2), (%0, %1, 4)) | |
1884 MEDIAN((%0, %1, 4) , (%%REGd) , (%%REGd, %1)) | |
1885 MEDIAN((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8)) | |
1886 | |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
1887 : : "r" (src), "r" ((x86_reg)stride) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1888 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1889 ); |
0 | 1890 #endif //HAVE_MMX2 |
1891 #else //HAVE_MMX | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1892 int x, y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1893 src+= 4*stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1894 // 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
|
1895 for(x=0; x<8; x++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1896 uint8_t *colsrc = src; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1897 for (y=0; y<4; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1898 int a, b, c, d, e, f; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1899 a = colsrc[0 ]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1900 b = colsrc[stride ]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1901 c = colsrc[stride*2]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1902 d = (a-b)>>31; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1903 e = (b-c)>>31; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1904 f = (c-a)>>31; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1905 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
|
1906 colsrc += stride*2; |
0 | 1907 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1908 src++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1909 } |
0 | 1910 #endif //HAVE_MMX |
1911 } | |
1912 | |
118 | 1913 #if HAVE_MMX |
0 | 1914 /** |
1915 * transposes and shift the given 8x8 Block into dst1 and dst2 | |
1916 */ | |
1917 static inline void RENAME(transpose1)(uint8_t *dst1, uint8_t *dst2, uint8_t *src, int srcStride) | |
1918 { | |
112 | 1919 __asm__( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1920 "lea (%0, %1), %%"REG_a" \n\t" |
0 | 1921 // 0 1 2 3 4 5 6 7 8 9 |
1922 // %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
|
1923 "movq (%0), %%mm0 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1924 "movq (%%"REG_a"), %%mm1 \n\t" // abcdefgh |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1925 "movq %%mm0, %%mm2 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1926 "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1927 "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1928 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1929 "movq (%%"REG_a", %1), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1930 "movq (%%"REG_a", %1, 2), %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1931 "movq %%mm1, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1932 "punpcklbw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1933 "punpckhbw %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1934 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1935 "movq %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1936 "punpcklwd %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1937 "punpckhwd %%mm1, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1938 "movq %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1939 "punpcklwd %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1940 "punpckhwd %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1941 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1942 "movd %%mm0, 128(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1943 "psrlq $32, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1944 "movd %%mm0, 144(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1945 "movd %%mm3, 160(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1946 "psrlq $32, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1947 "movd %%mm3, 176(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1948 "movd %%mm3, 48(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1949 "movd %%mm2, 192(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1950 "movd %%mm2, 64(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1951 "psrlq $32, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1952 "movd %%mm2, 80(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1953 "movd %%mm1, 96(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1954 "psrlq $32, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1955 "movd %%mm1, 112(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1956 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1957 "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
|
1958 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1959 "movq (%0, %1, 4), %%mm0 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1960 "movq (%%"REG_a"), %%mm1 \n\t" // abcdefgh |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1961 "movq %%mm0, %%mm2 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1962 "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1963 "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1964 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1965 "movq (%%"REG_a", %1), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1966 "movq (%%"REG_a", %1, 2), %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1967 "movq %%mm1, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1968 "punpcklbw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1969 "punpckhbw %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1970 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1971 "movq %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1972 "punpcklwd %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1973 "punpckhwd %%mm1, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1974 "movq %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1975 "punpcklwd %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1976 "punpckhwd %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1977 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1978 "movd %%mm0, 132(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1979 "psrlq $32, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1980 "movd %%mm0, 148(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1981 "movd %%mm3, 164(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1982 "psrlq $32, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1983 "movd %%mm3, 180(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1984 "movd %%mm3, 52(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1985 "movd %%mm2, 196(%2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1986 "movd %%mm2, 68(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1987 "psrlq $32, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1988 "movd %%mm2, 84(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1989 "movd %%mm1, 100(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1990 "psrlq $32, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1991 "movd %%mm1, 116(%3) \n\t" |
0 | 1992 |
1993 | |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
1994 :: "r" (src), "r" ((x86_reg)srcStride), "r" (dst1), "r" (dst2) |
0 | 1995 : "%"REG_a |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
1996 ); |
0 | 1997 } |
1998 | |
1999 /** | |
2000 * transposes the given 8x8 block | |
2001 */ | |
2002 static inline void RENAME(transpose2)(uint8_t *dst, int dstStride, uint8_t *src) | |
2003 { | |
112 | 2004 __asm__( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2005 "lea (%0, %1), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2006 "lea (%%"REG_a",%1,4), %%"REG_d" \n\t" |
0 | 2007 // 0 1 2 3 4 5 6 7 8 9 |
2008 // %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
|
2009 "movq (%2), %%mm0 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2010 "movq 16(%2), %%mm1 \n\t" // abcdefgh |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2011 "movq %%mm0, %%mm2 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2012 "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2013 "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2014 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2015 "movq 32(%2), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2016 "movq 48(%2), %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2017 "movq %%mm1, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2018 "punpcklbw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2019 "punpckhbw %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2020 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2021 "movq %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2022 "punpcklwd %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2023 "punpckhwd %%mm1, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2024 "movq %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2025 "punpcklwd %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2026 "punpckhwd %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2027 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2028 "movd %%mm0, (%0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2029 "psrlq $32, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2030 "movd %%mm0, (%%"REG_a") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2031 "movd %%mm3, (%%"REG_a", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2032 "psrlq $32, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2033 "movd %%mm3, (%%"REG_a", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2034 "movd %%mm2, (%0, %1, 4) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2035 "psrlq $32, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2036 "movd %%mm2, (%%"REG_d") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2037 "movd %%mm1, (%%"REG_d", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2038 "psrlq $32, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2039 "movd %%mm1, (%%"REG_d", %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2040 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2041 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2042 "movq 64(%2), %%mm0 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2043 "movq 80(%2), %%mm1 \n\t" // abcdefgh |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2044 "movq %%mm0, %%mm2 \n\t" // 12345678 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2045 "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2046 "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2047 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2048 "movq 96(%2), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2049 "movq 112(%2), %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2050 "movq %%mm1, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2051 "punpcklbw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2052 "punpckhbw %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2053 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2054 "movq %%mm0, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2055 "punpcklwd %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2056 "punpckhwd %%mm1, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2057 "movq %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2058 "punpcklwd %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2059 "punpckhwd %%mm4, %%mm1 \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 "movd %%mm0, 4(%0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2062 "psrlq $32, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2063 "movd %%mm0, 4(%%"REG_a") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2064 "movd %%mm3, 4(%%"REG_a", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2065 "psrlq $32, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2066 "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
|
2067 "movd %%mm2, 4(%0, %1, 4) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2068 "psrlq $32, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2069 "movd %%mm2, 4(%%"REG_d") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2070 "movd %%mm1, 4(%%"REG_d", %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2071 "psrlq $32, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2072 "movd %%mm1, 4(%%"REG_d", %1, 2) \n\t" |
0 | 2073 |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
2074 :: "r" (dst), "r" ((x86_reg)dstStride), "r" (src) |
0 | 2075 : "%"REG_a, "%"REG_d |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2076 ); |
0 | 2077 } |
2078 #endif //HAVE_MMX | |
2079 //static long test=0; | |
2080 | |
118 | 2081 #if !HAVE_ALTIVEC |
0 | 2082 static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride, |
98 | 2083 uint8_t *tempBlurred, uint32_t *tempBlurredPast, int *maxNoise) |
0 | 2084 { |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2085 // to save a register (FIXME do this outside of the loops) |
98 | 2086 tempBlurredPast[127]= maxNoise[0]; |
2087 tempBlurredPast[128]= maxNoise[1]; | |
2088 tempBlurredPast[129]= maxNoise[2]; | |
0 | 2089 |
2090 #define FAST_L2_DIFF | |
2091 //#define L1_DIFF //u should change the thresholds too if u try that one | |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
2092 #if HAVE_MMX2 || HAVE_AMD3DNOW |
112 | 2093 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2094 "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
|
2095 "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
|
2096 "lea (%%"REG_d", %2, 2), %%"REG_c" \n\t" // 7*stride |
0 | 2097 // 0 1 2 3 4 5 6 7 8 9 |
2098 // %x %x+%2 %x+2%2 %x+eax %x+4%2 %x+edx %x+2eax %x+ecx %x+8%2 | |
2099 //FIXME reorder? | |
2100 #ifdef L1_DIFF //needs mmx2 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2101 "movq (%0), %%mm0 \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2102 "psadbw (%1), %%mm0 \n\t" // |L0-R0| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2103 "movq (%0, %2), %%mm1 \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2104 "psadbw (%1, %2), %%mm1 \n\t" // |L1-R1| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2105 "movq (%0, %2, 2), %%mm2 \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2106 "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
|
2107 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2108 "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
|
2109 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2110 "movq (%0, %2, 4), %%mm4 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2111 "paddw %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2112 "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
|
2113 "movq (%0, %%"REG_d"), %%mm5 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2114 "paddw %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2115 "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
|
2116 "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
|
2117 "paddw %%mm3, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2118 "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
|
2119 "movq (%0, %%"REG_c"), %%mm7 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2120 "paddw %%mm4, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2121 "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
|
2122 "paddw %%mm5, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2123 "paddw %%mm7, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2124 "paddw %%mm6, %%mm0 \n\t" |
0 | 2125 #else //L1_DIFF |
2126 #if defined (FAST_L2_DIFF) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2127 "pcmpeqb %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2128 "movq "MANGLE(b80)", %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2129 "pxor %%mm0, %%mm0 \n\t" |
0 | 2130 #define REAL_L2_DIFF_CORE(a, b)\ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2131 "movq " #a ", %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2132 "movq " #b ", %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2133 "pxor %%mm7, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2134 PAVGB(%%mm2, %%mm5)\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2135 "paddb %%mm6, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2136 "movq %%mm5, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2137 "psllw $8, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2138 "pmaddwd %%mm5, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2139 "pmaddwd %%mm2, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2140 "paddd %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2141 "psrld $14, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2142 "paddd %%mm5, %%mm0 \n\t" |
0 | 2143 |
2144 #else //defined (FAST_L2_DIFF) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2145 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2146 "pxor %%mm0, %%mm0 \n\t" |
0 | 2147 #define REAL_L2_DIFF_CORE(a, b)\ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2148 "movq " #a ", %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2149 "movq " #b ", %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2150 "movq %%mm5, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2151 "movq %%mm2, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2152 "punpcklbw %%mm7, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2153 "punpckhbw %%mm7, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2154 "punpcklbw %%mm7, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2155 "punpckhbw %%mm7, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2156 "psubw %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2157 "psubw %%mm3, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2158 "pmaddwd %%mm5, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2159 "pmaddwd %%mm1, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2160 "paddd %%mm1, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2161 "paddd %%mm5, %%mm0 \n\t" |
0 | 2162 |
2163 #endif //defined (FAST_L2_DIFF) | |
2164 | |
2165 #define L2_DIFF_CORE(a, b) REAL_L2_DIFF_CORE(a, b) | |
2166 | |
2167 L2_DIFF_CORE((%0) , (%1)) | |
2168 L2_DIFF_CORE((%0, %2) , (%1, %2)) | |
2169 L2_DIFF_CORE((%0, %2, 2) , (%1, %2, 2)) | |
2170 L2_DIFF_CORE((%0, %%REGa) , (%1, %%REGa)) | |
2171 L2_DIFF_CORE((%0, %2, 4) , (%1, %2, 4)) | |
2172 L2_DIFF_CORE((%0, %%REGd) , (%1, %%REGd)) | |
2173 L2_DIFF_CORE((%0, %%REGa,2), (%1, %%REGa,2)) | |
2174 L2_DIFF_CORE((%0, %%REGc) , (%1, %%REGc)) | |
2175 | |
2176 #endif //L1_DIFF | |
2177 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2178 "movq %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2179 "psrlq $32, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2180 "paddd %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2181 "movd %%mm4, %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2182 "shll $2, %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2183 "mov %3, %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2184 "addl -4(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2185 "addl 4(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2186 "addl -1024(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2187 "addl $4, %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2188 "addl 1024(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2189 "shrl $3, %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2190 "movl %%ecx, (%%"REG_d") \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2191 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2192 // "mov %3, %%"REG_c" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2193 // "mov %%"REG_c", test \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2194 // "jmp 4f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2195 "cmpl 512(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2196 " jb 2f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2197 "cmpl 516(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2198 " jb 1f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2199 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2200 "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
|
2201 "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
|
2202 "movq (%0), %%mm0 \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2203 "movq (%0, %2), %%mm1 \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2204 "movq (%0, %2, 2), %%mm2 \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2205 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2206 "movq (%0, %2, 4), %%mm4 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2207 "movq (%0, %%"REG_d"), %%mm5 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2208 "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
|
2209 "movq (%0, %%"REG_c"), %%mm7 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2210 "movq %%mm0, (%1) \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2211 "movq %%mm1, (%1, %2) \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2212 "movq %%mm2, (%1, %2, 2) \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2213 "movq %%mm3, (%1, %%"REG_a") \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2214 "movq %%mm4, (%1, %2, 4) \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2215 "movq %%mm5, (%1, %%"REG_d") \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2216 "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
|
2217 "movq %%mm7, (%1, %%"REG_c") \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2218 "jmp 4f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2219 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2220 "1: \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2221 "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
|
2222 "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
|
2223 "movq (%0), %%mm0 \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2224 PAVGB((%1), %%mm0) // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2225 "movq (%0, %2), %%mm1 \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2226 PAVGB((%1, %2), %%mm1) // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2227 "movq (%0, %2, 2), %%mm2 \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2228 PAVGB((%1, %2, 2), %%mm2) // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2229 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2230 PAVGB((%1, %%REGa), %%mm3) // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2231 "movq (%0, %2, 4), %%mm4 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2232 PAVGB((%1, %2, 4), %%mm4) // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2233 "movq (%0, %%"REG_d"), %%mm5 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2234 PAVGB((%1, %%REGd), %%mm5) // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2235 "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
|
2236 PAVGB((%1, %%REGa, 2), %%mm6) // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2237 "movq (%0, %%"REG_c"), %%mm7 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2238 PAVGB((%1, %%REGc), %%mm7) // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2239 "movq %%mm0, (%1) \n\t" // R0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2240 "movq %%mm1, (%1, %2) \n\t" // R1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2241 "movq %%mm2, (%1, %2, 2) \n\t" // R2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2242 "movq %%mm3, (%1, %%"REG_a") \n\t" // R3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2243 "movq %%mm4, (%1, %2, 4) \n\t" // R4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2244 "movq %%mm5, (%1, %%"REG_d") \n\t" // R5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2245 "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
|
2246 "movq %%mm7, (%1, %%"REG_c") \n\t" // R7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2247 "movq %%mm0, (%0) \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2248 "movq %%mm1, (%0, %2) \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2249 "movq %%mm2, (%0, %2, 2) \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2250 "movq %%mm3, (%0, %%"REG_a") \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2251 "movq %%mm4, (%0, %2, 4) \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2252 "movq %%mm5, (%0, %%"REG_d") \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2253 "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
|
2254 "movq %%mm7, (%0, %%"REG_c") \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2255 "jmp 4f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2256 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2257 "2: \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2258 "cmpl 508(%%"REG_d"), %%ecx \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2259 " jb 3f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2260 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2261 "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
|
2262 "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
|
2263 "movq (%0), %%mm0 \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2264 "movq (%0, %2), %%mm1 \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2265 "movq (%0, %2, 2), %%mm2 \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2266 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2267 "movq (%1), %%mm4 \n\t" // R0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2268 "movq (%1, %2), %%mm5 \n\t" // R1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2269 "movq (%1, %2, 2), %%mm6 \n\t" // R2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2270 "movq (%1, %%"REG_a"), %%mm7 \n\t" // R3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2271 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2272 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2273 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2274 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2275 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2276 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2277 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2278 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2279 "movq %%mm0, (%1) \n\t" // R0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2280 "movq %%mm1, (%1, %2) \n\t" // R1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2281 "movq %%mm2, (%1, %2, 2) \n\t" // R2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2282 "movq %%mm3, (%1, %%"REG_a") \n\t" // R3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2283 "movq %%mm0, (%0) \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2284 "movq %%mm1, (%0, %2) \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2285 "movq %%mm2, (%0, %2, 2) \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2286 "movq %%mm3, (%0, %%"REG_a") \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2287 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2288 "movq (%0, %2, 4), %%mm0 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2289 "movq (%0, %%"REG_d"), %%mm1 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2290 "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
|
2291 "movq (%0, %%"REG_c"), %%mm3 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2292 "movq (%1, %2, 4), %%mm4 \n\t" // R4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2293 "movq (%1, %%"REG_d"), %%mm5 \n\t" // R5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2294 "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
|
2295 "movq (%1, %%"REG_c"), %%mm7 \n\t" // R7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2296 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2297 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2298 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2299 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2300 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2301 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2302 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2303 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2304 "movq %%mm0, (%1, %2, 4) \n\t" // R4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2305 "movq %%mm1, (%1, %%"REG_d") \n\t" // R5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2306 "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
|
2307 "movq %%mm3, (%1, %%"REG_c") \n\t" // R7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2308 "movq %%mm0, (%0, %2, 4) \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2309 "movq %%mm1, (%0, %%"REG_d") \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2310 "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
|
2311 "movq %%mm3, (%0, %%"REG_c") \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2312 "jmp 4f \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2313 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2314 "3: \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2315 "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
|
2316 "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
|
2317 "movq (%0), %%mm0 \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2318 "movq (%0, %2), %%mm1 \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2319 "movq (%0, %2, 2), %%mm2 \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2320 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2321 "movq (%1), %%mm4 \n\t" // R0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2322 "movq (%1, %2), %%mm5 \n\t" // R1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2323 "movq (%1, %2, 2), %%mm6 \n\t" // R2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2324 "movq (%1, %%"REG_a"), %%mm7 \n\t" // R3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2325 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2326 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2327 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2328 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2329 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2330 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2331 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2332 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2333 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2334 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2335 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2336 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2337 "movq %%mm0, (%1) \n\t" // R0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2338 "movq %%mm1, (%1, %2) \n\t" // R1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2339 "movq %%mm2, (%1, %2, 2) \n\t" // R2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2340 "movq %%mm3, (%1, %%"REG_a") \n\t" // R3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2341 "movq %%mm0, (%0) \n\t" // L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2342 "movq %%mm1, (%0, %2) \n\t" // L1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2343 "movq %%mm2, (%0, %2, 2) \n\t" // L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2344 "movq %%mm3, (%0, %%"REG_a") \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2345 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2346 "movq (%0, %2, 4), %%mm0 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2347 "movq (%0, %%"REG_d"), %%mm1 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2348 "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
|
2349 "movq (%0, %%"REG_c"), %%mm3 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2350 "movq (%1, %2, 4), %%mm4 \n\t" // R4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2351 "movq (%1, %%"REG_d"), %%mm5 \n\t" // R5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2352 "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
|
2353 "movq (%1, %%"REG_c"), %%mm7 \n\t" // R7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2354 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2355 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2356 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2357 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2358 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2359 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2360 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2361 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2362 PAVGB(%%mm4, %%mm0) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2363 PAVGB(%%mm5, %%mm1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2364 PAVGB(%%mm6, %%mm2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2365 PAVGB(%%mm7, %%mm3) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2366 "movq %%mm0, (%1, %2, 4) \n\t" // R4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2367 "movq %%mm1, (%1, %%"REG_d") \n\t" // R5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2368 "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
|
2369 "movq %%mm3, (%1, %%"REG_c") \n\t" // R7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2370 "movq %%mm0, (%0, %2, 4) \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2371 "movq %%mm1, (%0, %%"REG_d") \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2372 "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
|
2373 "movq %%mm3, (%0, %%"REG_c") \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2374 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2375 "4: \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2376 |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
2377 :: "r" (src), "r" (tempBlurred), "r"((x86_reg)stride), "m" (tempBlurredPast) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2378 : "%"REG_a, "%"REG_d, "%"REG_c, "memory" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2379 ); |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
2380 #else //HAVE_MMX2 || HAVE_AMD3DNOW |
0 | 2381 { |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2382 int y; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2383 int d=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2384 // int sysd=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2385 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2386 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2387 for(y=0; y<8; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2388 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2389 for(x=0; x<8; x++){ |
98 | 2390 int ref= tempBlurred[ x + y*stride ]; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2391 int cur= src[ x + y*stride ]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2392 int d1=ref - cur; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2393 // if(x==0 || x==7) d1+= d1>>1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2394 // if(y==0 || y==7) d1+= d1>>1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2395 // d+= FFABS(d1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2396 d+= d1*d1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2397 // sysd+= d1; |
0 | 2398 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2399 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2400 i=d; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2401 d= ( |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2402 4*d |
98 | 2403 +(*(tempBlurredPast-256)) |
2404 +(*(tempBlurredPast-1))+ (*(tempBlurredPast+1)) | |
2405 +(*(tempBlurredPast+256)) | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2406 +4)>>3; |
98 | 2407 *tempBlurredPast=i; |
2408 // ((*tempBlurredPast)*3 + d + 2)>>2; | |
0 | 2409 |
2410 /* | |
2411 Switch between | |
2412 1 0 0 0 0 0 0 (0) | |
2413 64 32 16 8 4 2 1 (1) | |
2414 64 48 36 27 20 15 11 (33) (approx) | |
2415 64 56 49 43 37 33 29 (200) (approx) | |
2416 */ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2417 if(d > maxNoise[1]){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2418 if(d < maxNoise[2]){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2419 for(y=0; y<8; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2420 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2421 for(x=0; x<8; x++){ |
98 | 2422 int ref= tempBlurred[ x + y*stride ]; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2423 int cur= src[ x + y*stride ]; |
98 | 2424 tempBlurred[ x + y*stride ]= |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2425 src[ x + y*stride ]= |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2426 (ref + cur + 1)>>1; |
0 | 2427 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2428 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2429 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2430 for(y=0; y<8; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2431 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2432 for(x=0; x<8; x++){ |
98 | 2433 tempBlurred[ x + y*stride ]= src[ x + y*stride ]; |
0 | 2434 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2435 } |
0 | 2436 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2437 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2438 if(d < maxNoise[0]){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2439 for(y=0; y<8; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2440 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2441 for(x=0; x<8; x++){ |
98 | 2442 int ref= tempBlurred[ x + y*stride ]; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2443 int cur= src[ x + y*stride ]; |
98 | 2444 tempBlurred[ x + y*stride ]= |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2445 src[ x + y*stride ]= |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2446 (ref*7 + cur + 4)>>3; |
0 | 2447 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2448 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2449 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2450 for(y=0; y<8; y++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2451 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2452 for(x=0; x<8; x++){ |
98 | 2453 int ref= tempBlurred[ x + y*stride ]; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2454 int cur= src[ x + y*stride ]; |
98 | 2455 tempBlurred[ x + y*stride ]= |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2456 src[ x + y*stride ]= |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2457 (ref*3 + cur + 2)>>2; |
0 | 2458 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2459 } |
0 | 2460 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2461 } |
0 | 2462 } |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
2463 #endif //HAVE_MMX2 || HAVE_AMD3DNOW |
0 | 2464 } |
2465 #endif //HAVE_ALTIVEC | |
2466 | |
118 | 2467 #if HAVE_MMX |
0 | 2468 /** |
2469 * accurate deblock filter | |
2470 */ | |
38
63d07317cd7a
rename always_inline to av_always_inline and move to common.h
mru
parents:
32
diff
changeset
|
2471 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
|
2472 int64_t dc_mask, eq_mask, both_masks; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2473 int64_t sums[10*8*2]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2474 src+= step*3; // src points to begin of the 8x8 Block |
0 | 2475 //START_TIMER |
112 | 2476 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2477 "movq %0, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2478 "movq %1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2479 : : "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
|
2480 ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2481 |
112 | 2482 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2483 "lea (%2, %3), %%"REG_a" \n\t" |
0 | 2484 // 0 1 2 3 4 5 6 7 8 9 |
2485 // %1 eax eax+%2 eax+2%2 %1+4%2 ecx ecx+%2 ecx+2%2 %1+8%2 ecx+4%2 | |
2486 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2487 "movq (%2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2488 "movq (%%"REG_a"), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2489 "movq %%mm1, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2490 "movq %%mm1, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2491 "psubb %%mm1, %%mm0 \n\t" // mm0 = differnece |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2492 "paddb %%mm7, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2493 "pcmpgtb %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2494 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2495 "movq (%%"REG_a",%3), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2496 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2497 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2498 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2499 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2500 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2501 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2502 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2503 "movq (%%"REG_a", %3, 2), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2504 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2505 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2506 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2507 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2508 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2509 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2510 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2511 "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
|
2512 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2513 "movq (%2, %3, 4), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2514 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2515 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2516 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2517 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2518 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2519 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2520 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2521 "movq (%%"REG_a"), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2522 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2523 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2524 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2525 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2526 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2527 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2528 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2529 "movq (%%"REG_a", %3), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2530 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2531 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2532 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2533 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2534 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2535 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2536 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2537 "movq (%%"REG_a", %3, 2), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2538 PMAXUB(%%mm1, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2539 PMINUB(%%mm1, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2540 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2541 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2542 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2543 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2544 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2545 "movq (%2, %3, 8), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2546 PMAXUB(%%mm2, %%mm4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2547 PMINUB(%%mm2, %%mm3, %%mm5) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2548 "psubb %%mm2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2549 "paddb %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2550 "pcmpgtb %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2551 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2552 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2553 "movq (%%"REG_a", %3, 4), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2554 "psubb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2555 "paddb %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2556 "pcmpgtb %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2557 "paddb %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2558 "psubusb %%mm3, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2559 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2560 "pxor %%mm6, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2561 "movq %4, %%mm7 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2562 "paddusb %%mm7, %%mm7 \n\t" // 2QP ... 2QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2563 "psubusb %%mm4, %%mm7 \n\t" // Diff >=2QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2564 "pcmpeqb %%mm6, %%mm7 \n\t" // Diff < 2QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2565 "pcmpeqb %%mm6, %%mm7 \n\t" // Diff < 2QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2566 "movq %%mm7, %1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2567 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2568 "movq %5, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2569 "punpcklbw %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2570 "punpcklbw %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2571 "punpcklbw %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2572 "psubb %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2573 "pcmpgtb %%mm7, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2574 "movq %%mm6, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2575 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2576 : "=m" (eq_mask), "=m" (dc_mask) |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
2577 : "r" (src), "r" ((x86_reg)step), "m" (c->pQPb), "m"(c->ppMode.flatnessThreshold) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2578 : "%"REG_a |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2579 ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2580 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2581 both_masks = dc_mask & eq_mask; |
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 if(both_masks){ |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
2584 x86_reg offset= -8*step; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2585 int64_t *temp_sums= sums; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2586 |
112 | 2587 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2588 "movq %2, %%mm0 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2589 "pxor %%mm4, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2590 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2591 "movq (%0), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2592 "movq (%0, %1), %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2593 "movq %%mm5, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2594 "movq %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2595 "psubusb %%mm6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2596 "psubusb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2597 "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
|
2598 "psubusb %%mm2, %%mm0 \n\t" // diff >= QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2599 "pcmpeqb %%mm4, %%mm0 \n\t" // diff >= QP -> FF |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2600 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2601 "pxor %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2602 "pand %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2603 "pxor %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2604 // 0:QP 6:First |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2605 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2606 "movq (%0, %1, 8), %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2607 "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
|
2608 "movq (%0, %1, 8), %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2609 "movq %%mm5, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2610 "movq %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2611 "psubusb %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2612 "psubusb %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2613 "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
|
2614 "movq %2, %%mm0 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2615 "psubusb %%mm2, %%mm0 \n\t" // diff >= QP -> 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2616 "pcmpeqb %%mm4, %%mm0 \n\t" // diff >= QP -> FF |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2617 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2618 "pxor %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2619 "pand %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2620 "pxor %%mm1, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2621 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2622 "movq %%mm6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2623 "punpckhbw %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2624 "punpcklbw %%mm4, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2625 // 4:0 5/6:First 7:Last |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2626 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2627 "movq %%mm5, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2628 "movq %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2629 "psllw $2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2630 "psllw $2, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2631 "paddw "MANGLE(w04)", %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2632 "paddw "MANGLE(w04)", %%mm1 \n\t" |
0 | 2633 |
2634 #define NEXT\ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2635 "movq (%0), %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2636 "movq (%0), %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2637 "add %1, %0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2638 "punpcklbw %%mm4, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2639 "punpckhbw %%mm4, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2640 "paddw %%mm2, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2641 "paddw %%mm3, %%mm1 \n\t" |
0 | 2642 |
2643 #define PREV\ | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2644 "movq (%0), %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2645 "movq (%0), %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2646 "add %1, %0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2647 "punpcklbw %%mm4, %%mm2 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2648 "punpckhbw %%mm4, %%mm3 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2649 "psubw %%mm2, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2650 "psubw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2651 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2652 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2653 NEXT //0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2654 NEXT //1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2655 NEXT //2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2656 "movq %%mm0, (%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2657 "movq %%mm1, 8(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2658 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2659 NEXT //3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2660 "psubw %%mm5, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2661 "psubw %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2662 "movq %%mm0, 16(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2663 "movq %%mm1, 24(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2664 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2665 NEXT //4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2666 "psubw %%mm5, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2667 "psubw %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2668 "movq %%mm0, 32(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2669 "movq %%mm1, 40(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2670 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2671 NEXT //5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2672 "psubw %%mm5, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2673 "psubw %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2674 "movq %%mm0, 48(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2675 "movq %%mm1, 56(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2676 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2677 NEXT //6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2678 "psubw %%mm5, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2679 "psubw %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2680 "movq %%mm0, 64(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2681 "movq %%mm1, 72(%3) \n\t" |
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 "movq %%mm7, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2684 "punpckhbw %%mm4, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2685 "punpcklbw %%mm4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2686 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2687 NEXT //7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2688 "mov %4, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2689 "add %1, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2690 PREV //0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2691 "movq %%mm0, 80(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2692 "movq %%mm1, 88(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2693 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2694 PREV //1 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2695 "paddw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2696 "paddw %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2697 "movq %%mm0, 96(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2698 "movq %%mm1, 104(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2699 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2700 PREV //2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2701 "paddw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2702 "paddw %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2703 "movq %%mm0, 112(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2704 "movq %%mm1, 120(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2705 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2706 PREV //3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2707 "paddw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2708 "paddw %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2709 "movq %%mm0, 128(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2710 "movq %%mm1, 136(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2711 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2712 PREV //4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2713 "paddw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2714 "paddw %%mm7, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2715 "movq %%mm0, 144(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2716 "movq %%mm1, 152(%3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2717 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2718 "mov %4, %0 \n\t" //FIXME |
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 : "+&r"(src) |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
2721 : "r" ((x86_reg)step), "m" (c->pQPb), "r"(sums), "g"(src) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2722 ); |
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 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
|
2725 |
112 | 2726 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2727 "movq %4, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2728 "pcmpeqb %%mm5, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2729 "pxor %%mm6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2730 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2731 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2732 "1: \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2733 "movq (%1), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2734 "movq 8(%1), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2735 "paddw 32(%1), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2736 "paddw 40(%1), %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2737 "movq (%0, %3), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2738 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2739 "movq %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2740 "punpcklbw %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2741 "punpckhbw %%mm7, %%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" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2744 "paddw %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2745 "paddw %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2746 "psrlw $4, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2747 "psrlw $4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2748 "packuswb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2749 "pand %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2750 "pand %%mm5, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2751 "por %%mm4, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2752 "movq %%mm0, (%0, %3) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2753 "add $16, %1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2754 "add %2, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2755 " js 1b \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2756 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2757 : "+r"(offset), "+r"(temp_sums) |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
2758 : "r" ((x86_reg)step), "r"(src - offset), "m"(both_masks) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2759 ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2760 }else |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2761 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
|
2762 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2763 if(eq_mask != -1LL){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2764 uint8_t *temp_src= src; |
112 | 2765 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2766 "pxor %%mm7, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2767 "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
|
2768 "and "ALIGN_MASK", %%"REG_c" \n\t" // align |
0 | 2769 // 0 1 2 3 4 5 6 7 8 9 |
2770 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %1+8%1 ecx+4%1 | |
2771 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2772 "movq (%0), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2773 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2774 "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
|
2775 "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
|
2776 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2777 "movq (%0, %1), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2778 "lea (%0, %1, 2), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2779 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2780 "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
|
2781 "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
|
2782 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2783 "movq (%%"REG_a"), %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2784 "movq %%mm4, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2785 "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
|
2786 "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
|
2787 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2788 "paddw %%mm0, %%mm0 \n\t" // 2L0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2789 "paddw %%mm1, %%mm1 \n\t" // 2H0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2790 "psubw %%mm4, %%mm2 \n\t" // L1 - L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2791 "psubw %%mm5, %%mm3 \n\t" // H1 - H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2792 "psubw %%mm2, %%mm0 \n\t" // 2L0 - L1 + L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2793 "psubw %%mm3, %%mm1 \n\t" // 2H0 - H1 + H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2794 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2795 "psllw $2, %%mm2 \n\t" // 4L1 - 4L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2796 "psllw $2, %%mm3 \n\t" // 4H1 - 4H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2797 "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2798 "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2799 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2800 "movq (%%"REG_a", %1), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2801 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2802 "punpcklbw %%mm7, %%mm2 \n\t" // L3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2803 "punpckhbw %%mm7, %%mm3 \n\t" // H3 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2804 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2805 "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
|
2806 "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
|
2807 "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
|
2808 "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
|
2809 "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
|
2810 "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
|
2811 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2812 "movq (%%"REG_a", %1, 2), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2813 "movq %%mm0, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2814 "punpcklbw %%mm7, %%mm0 \n\t" // L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2815 "punpckhbw %%mm7, %%mm1 \n\t" // H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2816 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2817 "psubw %%mm0, %%mm2 \n\t" // L3 - L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2818 "psubw %%mm1, %%mm3 \n\t" // H3 - H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2819 "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
|
2820 "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
|
2821 "paddw %%mm4, %%mm4 \n\t" // 2L2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2822 "paddw %%mm5, %%mm5 \n\t" // 2H2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2823 "psubw %%mm2, %%mm4 \n\t" // 2L2 - L3 + L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2824 "psubw %%mm3, %%mm5 \n\t" // 2H2 - H3 + H4 |
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 "lea (%%"REG_a", %1), %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2827 "psllw $2, %%mm2 \n\t" // 4L3 - 4L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2828 "psllw $2, %%mm3 \n\t" // 4H3 - 4H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2829 "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2830 "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 |
0 | 2831 //50 opcodes so far |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2832 "movq (%0, %1, 2), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2833 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2834 "punpcklbw %%mm7, %%mm2 \n\t" // L5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2835 "punpckhbw %%mm7, %%mm3 \n\t" // H5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2836 "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
|
2837 "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
|
2838 "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
|
2839 "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
|
2840 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2841 "movq (%%"REG_a", %1, 4), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2842 "punpcklbw %%mm7, %%mm6 \n\t" // L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2843 "psubw %%mm6, %%mm2 \n\t" // L5 - L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2844 "movq (%%"REG_a", %1, 4), %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2845 "punpckhbw %%mm7, %%mm6 \n\t" // H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2846 "psubw %%mm6, %%mm3 \n\t" // H5 - H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2847 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2848 "paddw %%mm0, %%mm0 \n\t" // 2L4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2849 "paddw %%mm1, %%mm1 \n\t" // 2H4 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2850 "psubw %%mm2, %%mm0 \n\t" // 2L4 - L5 + L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2851 "psubw %%mm3, %%mm1 \n\t" // 2H4 - H5 + H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2852 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2853 "psllw $2, %%mm2 \n\t" // 4L5 - 4L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2854 "psllw $2, %%mm3 \n\t" // 4H5 - 4H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2855 "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2856 "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2857 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2858 "movq (%0, %1, 4), %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2859 "movq %%mm2, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2860 "punpcklbw %%mm7, %%mm2 \n\t" // L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2861 "punpckhbw %%mm7, %%mm3 \n\t" // H7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2862 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2863 "paddw %%mm2, %%mm2 \n\t" // 2L7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2864 "paddw %%mm3, %%mm3 \n\t" // 2H7 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2865 "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
|
2866 "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
|
2867 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2868 "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
|
2869 "movq 8(%%"REG_c"), %%mm3 \n\t" // 2H0 - 5H1 + 5H2 - 2H3 |
0 | 2870 |
118 | 2871 #if HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2872 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2873 "psubw %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2874 "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
|
2875 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2876 "psubw %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2877 "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
|
2878 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2879 "psubw %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2880 "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
|
2881 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2882 "psubw %%mm3, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2883 "pmaxsw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| |
0 | 2884 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2885 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2886 "pcmpgtw %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2887 "pxor %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2888 "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
|
2889 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2890 "pcmpgtw %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2891 "pxor %%mm6, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2892 "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
|
2893 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2894 "pcmpgtw %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2895 "pxor %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2896 "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
|
2897 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2898 "pcmpgtw %%mm3, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2899 "pxor %%mm6, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2900 "psubw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| |
0 | 2901 #endif |
2902 | |
118 | 2903 #if HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2904 "pminsw %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2905 "pminsw %%mm3, %%mm1 \n\t" |
0 | 2906 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2907 "movq %%mm0, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2908 "psubusw %%mm2, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2909 "psubw %%mm6, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2910 "movq %%mm1, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2911 "psubusw %%mm3, %%mm6 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2912 "psubw %%mm6, %%mm1 \n\t" |
0 | 2913 #endif |
2914 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2915 "movd %2, %%mm2 \n\t" // QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2916 "punpcklbw %%mm7, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2917 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2918 "movq %%mm7, %%mm6 \n\t" // 0 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2919 "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
|
2920 "pxor %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2921 "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
|
2922 "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
|
2923 "pxor %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2924 "psubw %%mm7, %%mm5 \n\t" // |2H2 - 5H3 + 5H4 - 2H5| |
0 | 2925 // 100 opcodes |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2926 "psllw $3, %%mm2 \n\t" // 8QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2927 "movq %%mm2, %%mm3 \n\t" // 8QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2928 "pcmpgtw %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2929 "pcmpgtw %%mm5, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2930 "pand %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2931 "pand %%mm3, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2932 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2933 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2934 "psubusw %%mm0, %%mm4 \n\t" // hd |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2935 "psubusw %%mm1, %%mm5 \n\t" // ld |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2936 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2937 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2938 "movq "MANGLE(w05)", %%mm2 \n\t" // 5 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2939 "pmullw %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2940 "pmullw %%mm2, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2941 "movq "MANGLE(w20)", %%mm2 \n\t" // 32 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2942 "paddw %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2943 "paddw %%mm2, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2944 "psrlw $6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2945 "psrlw $6, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2946 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2947 "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
|
2948 "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
|
2949 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2950 "pxor %%mm2, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2951 "pxor %%mm3, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2952 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2953 "pcmpgtw %%mm0, %%mm2 \n\t" // sign (L3-L4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2954 "pcmpgtw %%mm1, %%mm3 \n\t" // sign (H3-H4) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2955 "pxor %%mm2, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2956 "pxor %%mm3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2957 "psubw %%mm2, %%mm0 \n\t" // |L3-L4| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2958 "psubw %%mm3, %%mm1 \n\t" // |H3-H4| |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2959 "psrlw $1, %%mm0 \n\t" // |L3 - L4|/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2960 "psrlw $1, %%mm1 \n\t" // |H3 - H4|/2 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2961 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2962 "pxor %%mm6, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2963 "pxor %%mm7, %%mm3 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2964 "pand %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2965 "pand %%mm3, %%mm5 \n\t" |
0 | 2966 |
118 | 2967 #if HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2968 "pminsw %%mm0, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2969 "pminsw %%mm1, %%mm5 \n\t" |
0 | 2970 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2971 "movq %%mm4, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2972 "psubusw %%mm0, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2973 "psubw %%mm2, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2974 "movq %%mm5, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2975 "psubusw %%mm1, %%mm2 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2976 "psubw %%mm2, %%mm5 \n\t" |
0 | 2977 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2978 "pxor %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2979 "pxor %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2980 "psubw %%mm6, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2981 "psubw %%mm7, %%mm5 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2982 "packsswb %%mm5, %%mm4 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2983 "movq %3, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2984 "pandn %%mm4, %%mm1 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2985 "movq (%0), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2986 "paddb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2987 "movq %%mm0, (%0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2988 "movq (%0, %1), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2989 "psubb %%mm1, %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2990 "movq %%mm0, (%0, %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2991 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2992 : "+r" (temp_src) |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
2993 : "r" ((x86_reg)step), "m" (c->pQPb), "m"(eq_mask) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2994 : "%"REG_a, "%"REG_c |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2995 ); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
2996 } |
0 | 2997 /*if(step==16){ |
2998 STOP_TIMER("step16") | |
2999 }else{ | |
3000 STOP_TIMER("stepX") | |
3001 }*/ | |
3002 } | |
3003 #endif //HAVE_MMX | |
3004 | |
78 | 3005 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
|
3006 const QP_STORE_T QPs[], int QPStride, int isColor, PPContext *c); |
0 | 3007 |
3008 /** | |
136 | 3009 * Copy a block from src to dst and fixes the blacklevel. |
48 | 3010 * levelFix == 0 -> do not touch the brighness & contrast |
0 | 3011 */ |
134
ced16a4fbbec
Fix warnings about redefining constants when compiling libpostproc.
cehoyos
parents:
133
diff
changeset
|
3012 #undef REAL_SCALED_CPY |
0 | 3013 #undef SCALED_CPY |
3014 | |
78 | 3015 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
|
3016 int levelFix, int64_t *packedOffsetAndScale) |
0 | 3017 { |
118 | 3018 #if !HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3019 int i; |
0 | 3020 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3021 if(levelFix){ |
118 | 3022 #if HAVE_MMX |
112 | 3023 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3024 "movq (%%"REG_a"), %%mm2 \n\t" // packedYOffset |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3025 "movq 8(%%"REG_a"), %%mm3 \n\t" // packedYScale |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3026 "lea (%2,%4), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3027 "lea (%3,%5), %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3028 "pxor %%mm4, %%mm4 \n\t" |
118 | 3029 #if HAVE_MMX2 |
0 | 3030 #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
|
3031 "movq " #src1 ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3032 "movq " #src1 ", %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3033 "movq " #src2 ", %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3034 "movq " #src2 ", %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3035 "punpcklbw %%mm0, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3036 "punpckhbw %%mm5, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3037 "punpcklbw %%mm1, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3038 "punpckhbw %%mm6, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3039 "pmulhuw %%mm3, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3040 "pmulhuw %%mm3, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3041 "pmulhuw %%mm3, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3042 "pmulhuw %%mm3, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3043 "psubw %%mm2, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3044 "psubw %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3045 "psubw %%mm2, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3046 "psubw %%mm2, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3047 "packuswb %%mm5, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3048 "packuswb %%mm6, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3049 "movq %%mm0, " #dst1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3050 "movq %%mm1, " #dst2 " \n\t"\ |
0 | 3051 |
3052 #else //HAVE_MMX2 | |
3053 #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
|
3054 "movq " #src1 ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3055 "movq " #src1 ", %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3056 "punpcklbw %%mm4, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3057 "punpckhbw %%mm4, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3058 "psubw %%mm2, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3059 "psubw %%mm2, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3060 "movq " #src2 ", %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3061 "psllw $6, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3062 "psllw $6, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3063 "pmulhw %%mm3, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3064 "movq " #src2 ", %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3065 "pmulhw %%mm3, %%mm5 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3066 "punpcklbw %%mm4, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3067 "punpckhbw %%mm4, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3068 "psubw %%mm2, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3069 "psubw %%mm2, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3070 "psllw $6, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3071 "psllw $6, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3072 "pmulhw %%mm3, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3073 "pmulhw %%mm3, %%mm6 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3074 "packuswb %%mm5, %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3075 "packuswb %%mm6, %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3076 "movq %%mm0, " #dst1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3077 "movq %%mm1, " #dst2 " \n\t"\ |
0 | 3078 |
3079 #endif //HAVE_MMX2 | |
3080 #define SCALED_CPY(src1, src2, dst1, dst2)\ | |
3081 REAL_SCALED_CPY(src1, src2, dst1, dst2) | |
3082 | |
3083 SCALED_CPY((%2) , (%2, %4) , (%3) , (%3, %5)) | |
3084 SCALED_CPY((%2, %4, 2), (%%REGa, %4, 2), (%3, %5, 2), (%%REGd, %5, 2)) | |
3085 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
|
3086 "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
|
3087 "lea (%%"REG_d",%5,4), %%"REG_d" \n\t" |
0 | 3088 SCALED_CPY((%%REGa, %4), (%%REGa, %4, 2), (%%REGd, %5), (%%REGd, %5, 2)) |
3089 | |
3090 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3091 : "=&a" (packedOffsetAndScale) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3092 : "0" (packedOffsetAndScale), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3093 "r"(src), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3094 "r"(dst), |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
3095 "r" ((x86_reg)srcStride), |
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
3096 "r" ((x86_reg)dstStride) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3097 : "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3098 ); |
0 | 3099 #else //HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3100 for(i=0; i<8; i++) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3101 memcpy( &(dst[dstStride*i]), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3102 &(src[srcStride*i]), BLOCK_SIZE); |
0 | 3103 #endif //HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3104 }else{ |
118 | 3105 #if HAVE_MMX |
112 | 3106 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3107 "lea (%0,%2), %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3108 "lea (%1,%3), %%"REG_d" \n\t" |
0 | 3109 |
3110 #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
|
3111 "movq " #src1 ", %%mm0 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3112 "movq " #src2 ", %%mm1 \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3113 "movq %%mm0, " #dst1 " \n\t"\ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3114 "movq %%mm1, " #dst2 " \n\t"\ |
0 | 3115 |
3116 #define SIMPLE_CPY(src1, src2, dst1, dst2)\ | |
3117 REAL_SIMPLE_CPY(src1, src2, dst1, dst2) | |
3118 | |
3119 SIMPLE_CPY((%0) , (%0, %2) , (%1) , (%1, %3)) | |
3120 SIMPLE_CPY((%0, %2, 2), (%%REGa, %2, 2), (%1, %3, 2), (%%REGd, %3, 2)) | |
3121 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
|
3122 "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
|
3123 "lea (%%"REG_d",%3,4), %%"REG_d" \n\t" |
0 | 3124 SIMPLE_CPY((%%REGa, %2), (%%REGa, %2, 2), (%%REGd, %3), (%%REGd, %3, 2)) |
3125 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3126 : : "r" (src), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3127 "r" (dst), |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
3128 "r" ((x86_reg)srcStride), |
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
3129 "r" ((x86_reg)dstStride) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3130 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3131 ); |
0 | 3132 #else //HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3133 for(i=0; i<8; i++) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3134 memcpy( &(dst[dstStride*i]), |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3135 &(src[srcStride*i]), BLOCK_SIZE); |
0 | 3136 #endif //HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3137 } |
0 | 3138 } |
3139 | |
3140 /** | |
136 | 3141 * Duplicate the given 8 src pixels ? times upward |
0 | 3142 */ |
3143 static inline void RENAME(duplicate)(uint8_t src[], int stride) | |
3144 { | |
118 | 3145 #if HAVE_MMX |
112 | 3146 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3147 "movq (%0), %%mm0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3148 "add %1, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3149 "movq %%mm0, (%0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3150 "movq %%mm0, (%0, %1) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3151 "movq %%mm0, (%0, %1, 2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3152 : "+r" (src) |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
3153 : "r" ((x86_reg)-stride) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3154 ); |
0 | 3155 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3156 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3157 uint8_t *p=src; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3158 for(i=0; i<3; i++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3159 p-= stride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3160 memcpy(p, src, 8); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3161 } |
0 | 3162 #endif |
3163 } | |
3164 | |
3165 /** | |
136 | 3166 * Filter array of bytes (Y or U or V values) |
0 | 3167 */ |
78 | 3168 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
|
3169 const QP_STORE_T QPs[], int QPStride, int isColor, PPContext *c2) |
0 | 3170 { |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3171 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
|
3172 int x,y; |
0 | 3173 #ifdef COMPILE_TIME_MODE |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3174 const int mode= COMPILE_TIME_MODE; |
0 | 3175 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3176 const int mode= isColor ? c.ppMode.chromMode : c.ppMode.lumMode; |
0 | 3177 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3178 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
|
3179 int QPCorrecture= 256*256; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3180 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3181 int copyAhead; |
118 | 3182 #if HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3183 int i; |
0 | 3184 #endif |
3185 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3186 const int qpHShift= isColor ? 4-c.hChromaSubSample : 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3187 const int qpVShift= isColor ? 4-c.vChromaSubSample : 4; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3188 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3189 //FIXME remove |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3190 uint64_t * const yHistogram= c.yHistogram; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3191 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
|
3192 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
|
3193 //const int mbWidth= isColor ? (width+7)>>3 : (width+15)>>4; |
0 | 3194 |
118 | 3195 #if HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3196 for(i=0; i<57; i++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3197 int offset= ((i*c.ppMode.baseDcDiff)>>8) + 1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3198 int threshold= offset*2 + 1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3199 c.mmxDcOffset[i]= 0x7F - offset; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3200 c.mmxDcThreshold[i]= 0x7F - threshold; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3201 c.mmxDcOffset[i]*= 0x0101010101010101LL; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3202 c.mmxDcThreshold[i]*= 0x0101010101010101LL; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3203 } |
0 | 3204 #endif |
3205 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3206 if(mode & CUBIC_IPOL_DEINT_FILTER) copyAhead=16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3207 else if( (mode & LINEAR_BLEND_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3208 || (mode & FFMPEG_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3209 || (mode & LOWPASS5_DEINT_FILTER)) copyAhead=14; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3210 else if( (mode & V_DEBLOCK) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3211 || (mode & LINEAR_IPOL_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3212 || (mode & MEDIAN_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3213 || (mode & V_A_DEBLOCK)) copyAhead=13; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3214 else if(mode & V_X1_FILTER) copyAhead=11; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3215 // else if(mode & V_RK1_FILTER) copyAhead=10; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3216 else if(mode & DERING) copyAhead=9; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3217 else copyAhead=8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3218 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3219 copyAhead-= 8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3220 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3221 if(!isColor){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3222 uint64_t sum= 0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3223 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3224 uint64_t maxClipped; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3225 uint64_t clipped; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3226 double scale; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3227 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3228 c.frameNum++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3229 // first frame is fscked so we ignore it |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3230 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
|
3231 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3232 for(i=0; i<256; i++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3233 sum+= yHistogram[i]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3234 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3235 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3236 /* We always get a completely black picture first. */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3237 maxClipped= (uint64_t)(sum * c.ppMode.maxClippedThreshold); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3238 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3239 clipped= sum; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3240 for(black=255; black>0; black--){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3241 if(clipped < maxClipped) break; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3242 clipped-= yHistogram[black]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3243 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3244 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3245 clipped= sum; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3246 for(white=0; white<256; white++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3247 if(clipped < maxClipped) break; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3248 clipped-= yHistogram[white]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3249 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3250 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3251 scale= (double)(c.ppMode.maxAllowedY - c.ppMode.minAllowedY) / (double)(white-black); |
0 | 3252 |
118 | 3253 #if HAVE_MMX2 |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3254 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
|
3255 c.packedYOffset= (((black*c.packedYScale)>>8) - c.ppMode.minAllowedY) & 0xFFFF; |
0 | 3256 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3257 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
|
3258 c.packedYOffset= (black - c.ppMode.minAllowedY) & 0xFFFF; |
0 | 3259 #endif |
3260 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3261 c.packedYOffset|= c.packedYOffset<<32; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3262 c.packedYOffset|= c.packedYOffset<<16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3263 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3264 c.packedYScale|= c.packedYScale<<32; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3265 c.packedYScale|= c.packedYScale<<16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3266 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3267 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
|
3268 else QPCorrecture= 256*256; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3269 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3270 c.packedYScale= 0x0100010001000100LL; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3271 c.packedYOffset= 0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3272 QPCorrecture= 256*256; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3273 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3274 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3275 /* copy & deinterlace first row of blocks */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3276 y=-BLOCK_SIZE; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3277 { |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3278 const uint8_t *srcBlock= &(src[y*srcStride]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3279 uint8_t *dstBlock= tempDst + dstStride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3280 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3281 // 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
|
3282 // 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
|
3283 // 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
|
3284 for(x=0; x<width; x+=BLOCK_SIZE){ |
0 | 3285 |
118 | 3286 #if HAVE_MMX2 |
0 | 3287 /* |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3288 prefetchnta(srcBlock + (((x>>2)&6) + 5)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3289 prefetchnta(srcBlock + (((x>>2)&6) + 6)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3290 prefetcht0(dstBlock + (((x>>2)&6) + 5)*dstStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3291 prefetcht0(dstBlock + (((x>>2)&6) + 6)*dstStride + 32); |
0 | 3292 */ |
3293 | |
112 | 3294 __asm__( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3295 "mov %4, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3296 "shr $2, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3297 "and $6, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3298 "add %5, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3299 "mov %%"REG_a", %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3300 "imul %1, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3301 "imul %3, %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3302 "prefetchnta 32(%%"REG_a", %0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3303 "prefetcht0 32(%%"REG_d", %2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3304 "add %1, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3305 "add %3, %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3306 "prefetchnta 32(%%"REG_a", %0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3307 "prefetcht0 32(%%"REG_d", %2) \n\t" |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
3308 :: "r" (srcBlock), "r" ((x86_reg)srcStride), "r" (dstBlock), "r" ((x86_reg)dstStride), |
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
3309 "g" ((x86_reg)x), "g" ((x86_reg)copyAhead) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3310 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3311 ); |
0 | 3312 |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
3313 #elif HAVE_AMD3DNOW |
49 | 3314 //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
|
3315 /* prefetch(srcBlock + (((x>>3)&3) + 5)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3316 prefetch(srcBlock + (((x>>3)&3) + 9)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3317 prefetchw(dstBlock + (((x>>3)&3) + 5)*dstStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3318 prefetchw(dstBlock + (((x>>3)&3) + 9)*dstStride + 32); |
0 | 3319 */ |
3320 #endif | |
3321 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3322 RENAME(blockCopy)(dstBlock + dstStride*8, dstStride, |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3323 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
|
3324 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3325 RENAME(duplicate)(dstBlock + dstStride*8, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3326 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3327 if(mode & LINEAR_IPOL_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3328 RENAME(deInterlaceInterpolateLinear)(dstBlock, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3329 else if(mode & LINEAR_BLEND_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3330 RENAME(deInterlaceBlendLinear)(dstBlock, dstStride, c.deintTemp + x); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3331 else if(mode & MEDIAN_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3332 RENAME(deInterlaceMedian)(dstBlock, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3333 else if(mode & CUBIC_IPOL_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3334 RENAME(deInterlaceInterpolateCubic)(dstBlock, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3335 else if(mode & FFMPEG_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3336 RENAME(deInterlaceFF)(dstBlock, dstStride, c.deintTemp + x); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3337 else if(mode & LOWPASS5_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3338 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
|
3339 /* else if(mode & CUBIC_BLEND_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3340 RENAME(deInterlaceBlendCubic)(dstBlock, dstStride); |
0 | 3341 */ |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3342 dstBlock+=8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3343 srcBlock+=8; |
0 | 3344 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3345 if(width==FFABS(dstStride)) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3346 linecpy(dst, tempDst + 9*dstStride, copyAhead, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3347 else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3348 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3349 for(i=0; i<copyAhead; i++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3350 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
|
3351 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3352 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3353 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3354 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3355 for(y=0; y<height; y+=BLOCK_SIZE){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3356 //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
|
3357 const uint8_t *srcBlock= &(src[y*srcStride]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3358 uint8_t *dstBlock= &(dst[y*dstStride]); |
118 | 3359 #if HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3360 uint8_t *tempBlock1= c.tempBlocks; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3361 uint8_t *tempBlock2= c.tempBlocks + 8; |
0 | 3362 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3363 const int8_t *QPptr= &QPs[(y>>qpVShift)*QPStride]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3364 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
|
3365 int QP=0; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3366 /* 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
|
3367 if not than use a temporary buffer */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3368 if(y+15 >= height){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3369 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3370 /* 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
|
3371 blockcopy to dst later */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3372 linecpy(tempSrc + srcStride*copyAhead, srcBlock + srcStride*copyAhead, |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3373 FFMAX(height-y-copyAhead, 0), srcStride); |
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 /* 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
|
3376 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
|
3377 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
|
3378 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3379 /* 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
|
3380 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
|
3381 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3382 /* 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
|
3383 for(i=height-y+1; i<=copyAhead; i++) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3384 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
|
3385 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3386 dstBlock= tempDst + dstStride; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3387 srcBlock= tempSrc; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3388 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3389 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3390 // 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
|
3391 // 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
|
3392 // 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
|
3393 for(x=0; x<width; x+=BLOCK_SIZE){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3394 const int stride= dstStride; |
118 | 3395 #if HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3396 uint8_t *tmpXchg; |
0 | 3397 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3398 if(isColor){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3399 QP= QPptr[x>>qpHShift]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3400 c.nonBQP= nonBQPptr[x>>qpHShift]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3401 }else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3402 QP= QPptr[x>>4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3403 QP= (QP* QPCorrecture + 256*128)>>16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3404 c.nonBQP= nonBQPptr[x>>4]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3405 c.nonBQP= (c.nonBQP* QPCorrecture + 256*128)>>16; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3406 yHistogram[ srcBlock[srcStride*12 + 4] ]++; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3407 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3408 c.QP= QP; |
118 | 3409 #if HAVE_MMX |
112 | 3410 __asm__ volatile( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3411 "movd %1, %%mm7 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3412 "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
|
3413 "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
|
3414 "packuswb %%mm7, %%mm7 \n\t" // QP,..., QP |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3415 "movq %%mm7, %0 \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3416 : "=m" (c.pQPb) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3417 : "r" (QP) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3418 ); |
0 | 3419 #endif |
3420 | |
3421 | |
118 | 3422 #if HAVE_MMX2 |
0 | 3423 /* |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3424 prefetchnta(srcBlock + (((x>>2)&6) + 5)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3425 prefetchnta(srcBlock + (((x>>2)&6) + 6)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3426 prefetcht0(dstBlock + (((x>>2)&6) + 5)*dstStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3427 prefetcht0(dstBlock + (((x>>2)&6) + 6)*dstStride + 32); |
0 | 3428 */ |
3429 | |
112 | 3430 __asm__( |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3431 "mov %4, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3432 "shr $2, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3433 "and $6, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3434 "add %5, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3435 "mov %%"REG_a", %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3436 "imul %1, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3437 "imul %3, %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3438 "prefetchnta 32(%%"REG_a", %0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3439 "prefetcht0 32(%%"REG_d", %2) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3440 "add %1, %%"REG_a" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3441 "add %3, %%"REG_d" \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3442 "prefetchnta 32(%%"REG_a", %0) \n\t" |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3443 "prefetcht0 32(%%"REG_d", %2) \n\t" |
113
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
3444 :: "r" (srcBlock), "r" ((x86_reg)srcStride), "r" (dstBlock), "r" ((x86_reg)dstStride), |
bf8f52662dc3
Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents:
112
diff
changeset
|
3445 "g" ((x86_reg)x), "g" ((x86_reg)copyAhead) |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3446 : "%"REG_a, "%"REG_d |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3447 ); |
0 | 3448 |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
3449 #elif HAVE_AMD3DNOW |
49 | 3450 //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
|
3451 /* prefetch(srcBlock + (((x>>3)&3) + 5)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3452 prefetch(srcBlock + (((x>>3)&3) + 9)*srcStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3453 prefetchw(dstBlock + (((x>>3)&3) + 5)*dstStride + 32); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3454 prefetchw(dstBlock + (((x>>3)&3) + 9)*dstStride + 32); |
0 | 3455 */ |
3456 #endif | |
3457 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3458 RENAME(blockCopy)(dstBlock + dstStride*copyAhead, dstStride, |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3459 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
|
3460 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3461 if(mode & LINEAR_IPOL_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3462 RENAME(deInterlaceInterpolateLinear)(dstBlock, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3463 else if(mode & LINEAR_BLEND_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3464 RENAME(deInterlaceBlendLinear)(dstBlock, dstStride, c.deintTemp + x); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3465 else if(mode & MEDIAN_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3466 RENAME(deInterlaceMedian)(dstBlock, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3467 else if(mode & CUBIC_IPOL_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3468 RENAME(deInterlaceInterpolateCubic)(dstBlock, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3469 else if(mode & FFMPEG_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3470 RENAME(deInterlaceFF)(dstBlock, dstStride, c.deintTemp + x); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3471 else if(mode & LOWPASS5_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3472 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
|
3473 /* else if(mode & CUBIC_BLEND_DEINT_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3474 RENAME(deInterlaceBlendCubic)(dstBlock, dstStride); |
0 | 3475 */ |
3476 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3477 /* only deblock if we have 2 blocks */ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3478 if(y + 8 < height){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3479 if(mode & V_X1_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3480 RENAME(vertX1Filter)(dstBlock, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3481 else if(mode & V_DEBLOCK){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3482 const int t= RENAME(vertClassify)(dstBlock, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3483 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3484 if(t==1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3485 RENAME(doVertLowPass)(dstBlock, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3486 else if(t==2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3487 RENAME(doVertDefFilter)(dstBlock, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3488 }else if(mode & V_A_DEBLOCK){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3489 RENAME(do_a_deblock)(dstBlock, stride, 1, &c); |
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 } |
0 | 3492 |
118 | 3493 #if HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3494 RENAME(transpose1)(tempBlock1, tempBlock2, dstBlock, dstStride); |
0 | 3495 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3496 /* 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
|
3497 if(x - 8 >= 0){ |
118 | 3498 #if HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3499 if(mode & H_X1_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3500 RENAME(vertX1Filter)(tempBlock1, 16, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3501 else if(mode & H_DEBLOCK){ |
0 | 3502 //START_TIMER |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3503 const int t= RENAME(vertClassify)(tempBlock1, 16, &c); |
0 | 3504 //STOP_TIMER("dc & minmax") |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3505 if(t==1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3506 RENAME(doVertLowPass)(tempBlock1, 16, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3507 else if(t==2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3508 RENAME(doVertDefFilter)(tempBlock1, 16, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3509 }else if(mode & H_A_DEBLOCK){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3510 RENAME(do_a_deblock)(tempBlock1, 16, 1, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3511 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3512 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3513 RENAME(transpose2)(dstBlock-4, dstStride, tempBlock1 + 4*16); |
0 | 3514 |
3515 #else | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3516 if(mode & H_X1_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3517 horizX1Filter(dstBlock-4, stride, QP); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3518 else if(mode & H_DEBLOCK){ |
118 | 3519 #if HAVE_ALTIVEC |
133
51571e34b760
Move array specifiers outside DECLARE_ALIGNED() invocations
mru
parents:
129
diff
changeset
|
3520 DECLARE_ALIGNED(16, unsigned char, tempBlock)[272]; |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3521 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
|
3522 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3523 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
|
3524 if(t==1) { |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3525 doVertLowPass_altivec(tempBlock-48, 16, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3526 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
|
3527 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3528 else if(t==2) { |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3529 doVertDefFilter_altivec(tempBlock-48, 16, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3530 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
|
3531 } |
0 | 3532 #else |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3533 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
|
3534 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3535 if(t==1) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3536 RENAME(doHorizLowPass)(dstBlock-4, stride, &c); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3537 else if(t==2) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3538 RENAME(doHorizDefFilter)(dstBlock-4, stride, &c); |
0 | 3539 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3540 }else if(mode & H_A_DEBLOCK){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3541 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
|
3542 } |
0 | 3543 #endif //HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3544 if(mode & DERING){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3545 //FIXME filter first line |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3546 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
|
3547 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3548 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3549 if(mode & TEMP_NOISE_FILTER) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3550 { |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3551 RENAME(tempNoiseReducer)(dstBlock-8, stride, |
98 | 3552 c.tempBlurred[isColor] + y*dstStride + x, |
3553 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
|
3554 c.ppMode.maxTmpNoise); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3555 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3556 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3557 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3558 dstBlock+=8; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3559 srcBlock+=8; |
0 | 3560 |
118 | 3561 #if HAVE_MMX |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3562 tmpXchg= tempBlock1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3563 tempBlock1= tempBlock2; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3564 tempBlock2 = tmpXchg; |
0 | 3565 #endif |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3566 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3567 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3568 if(mode & DERING){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3569 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
|
3570 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3571 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3572 if((mode & TEMP_NOISE_FILTER)){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3573 RENAME(tempNoiseReducer)(dstBlock-8, dstStride, |
98 | 3574 c.tempBlurred[isColor] + y*dstStride + x, |
3575 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
|
3576 c.ppMode.maxTmpNoise); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3577 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3578 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3579 /* 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
|
3580 if(y+15 >= height){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3581 uint8_t *dstBlock= &(dst[y*dstStride]); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3582 if(width==FFABS(dstStride)) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3583 linecpy(dstBlock, tempDst + dstStride, height-y, dstStride); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3584 else{ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3585 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3586 for(i=0; i<height-y; i++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3587 memcpy(dstBlock + i*dstStride, tempDst + (i+1)*dstStride, width); |
0 | 3588 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3589 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3590 } |
0 | 3591 /* |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3592 for(x=0; x<width; x+=32){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3593 volatile int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3594 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
|
3595 + dstBlock[x + 9*dstStride] + dstBlock[x +10*dstStride] |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3596 + dstBlock[x +11*dstStride] + dstBlock[x +12*dstStride]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3597 + dstBlock[x +13*dstStride] |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3598 + dstBlock[x +14*dstStride] + dstBlock[x +15*dstStride]; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3599 }*/ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3600 } |
121
dd89aa84269b
HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents:
119
diff
changeset
|
3601 #if HAVE_AMD3DNOW |
112 | 3602 __asm__ volatile("femms"); |
118 | 3603 #elif HAVE_MMX |
112 | 3604 __asm__ volatile("emms"); |
0 | 3605 #endif |
3606 | |
3607 #ifdef DEBUG_BRIGHTNESS | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3608 if(!isColor){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3609 int max=1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3610 int i; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3611 for(i=0; i<256; i++) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3612 if(yHistogram[i] > max) max=yHistogram[i]; |
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 for(i=1; i<256; i++){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3615 int x; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3616 int start=yHistogram[i-1]/(max/256+1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3617 int end=yHistogram[i]/(max/256+1); |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3618 int inc= end > start ? 1 : -1; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3619 for(x=start; x!=end+inc; x+=inc) |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3620 dst[ i*dstStride + x]+=128; |
0 | 3621 } |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3622 |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3623 for(i=0; i<100; i+=2){ |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3624 dst[ (white)*dstStride + i]+=128; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3625 dst[ (black)*dstStride + i]+=128; |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3626 } |
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3627 } |
0 | 3628 #endif |
3629 | |
95
c24dab9bca80
cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents:
92
diff
changeset
|
3630 *c2= c; //copy local context back |
0 | 3631 |
3632 } |