annotate postprocess_template.c @ 131:63eddcff3509 libpostproc

Prefer "*FUNC_NAME(" over "* FUNC_NAME(" for XXX_configuration() and XXX_license() functions, consistent with the rest of FFmpeg.
author stefano
date Sun, 03 Jan 2010 14:31:25 +0000
parents c78bbb57f0b9
children 51571e34b760
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
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
95d9409452f2 license header consistency cosmetics
diego
parents: 49
diff changeset
19 */
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
20
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
21 /**
122
1500ae6cf66c Use full internal pathname in doxygen @file directives.
diego
parents: 121
diff changeset
22 * @file libpostproc/postprocess_template.c
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
23 * mmx/mmx2/3dnow postprocess code.
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
24 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
25
108
83d51d1fb580 Use full path for #includes from another directory.
diego
parents: 98
diff changeset
26 #include "libavutil/x86_cpu.h"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
27
92
a8ed701a0873 simplify ALIGN_MASK definition
mru
parents: 91
diff changeset
28 #define ALIGN_MASK "$-8"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
29
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
30 #undef PAVGB
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
31 #undef PMINUB
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
32 #undef PMAXUB
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
33
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
34 #if HAVE_MMX2
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
35 #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
36 #elif HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
37 #define REAL_PAVGB(a,b) "pavgusb " #a ", " #b " \n\t"
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
38 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
39 #define PAVGB(a,b) REAL_PAVGB(a,b)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
40
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
41 #if HAVE_MMX2
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
42 #define PMINUB(a,b,t) "pminub " #a ", " #b " \n\t"
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
43 #elif HAVE_MMX
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
44 #define PMINUB(b,a,t) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
45 "movq " #a ", " #t " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
46 "psubusb " #b ", " #t " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
47 "psubb " #t ", " #a " \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
48 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
49
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
50 #if HAVE_MMX2
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
51 #define PMAXUB(a,b) "pmaxub " #a ", " #b " \n\t"
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
52 #elif HAVE_MMX
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
53 #define PMAXUB(a,b) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
54 "psubusb " #a ", " #b " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
55 "paddb " #a ", " #b " \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
56 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
57
48
72675332ed82 misc spelling fixes
diego
parents: 45
diff changeset
58 //FIXME? |255-0| = 1 (should not be a problem ...)
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
59 #if HAVE_MMX
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
60 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
61 * Check if the middle 8x8 Block in the given 8x16 block is flat
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
62 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
63 static inline int RENAME(vertClassify)(uint8_t src[], int stride, PPContext *c){
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
64 int numEq= 0, dcOk;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
65 src+= stride*4; // src points to begin of the 8x8 Block
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
66 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
67 "movq %0, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
68 "movq %1, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
69 : : "m" (c->mmxDcOffset[c->nonBQP]), "m" (c->mmxDcThreshold[c->nonBQP])
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
70 );
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
71
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
72 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
73 "lea (%2, %3), %%"REG_a" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
74 // 0 1 2 3 4 5 6 7 8 9
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
75 // %1 eax eax+%2 eax+2%2 %1+4%2 ecx ecx+%2 ecx+2%2 %1+8%2 ecx+4%2
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
76
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
77 "movq (%2), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
78 "movq (%%"REG_a"), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
79 "movq %%mm0, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
80 "movq %%mm0, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
81 PMAXUB(%%mm1, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
82 PMINUB(%%mm1, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
83 "psubb %%mm1, %%mm0 \n\t" // mm0 = differnece
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
84 "paddb %%mm7, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
85 "pcmpgtb %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
86
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
87 "movq (%%"REG_a",%3), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
88 PMAXUB(%%mm2, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
89 PMINUB(%%mm2, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
90 "psubb %%mm2, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
91 "paddb %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
92 "pcmpgtb %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
93 "paddb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
94
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
95 "movq (%%"REG_a", %3, 2), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
96 PMAXUB(%%mm1, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
97 PMINUB(%%mm1, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
98 "psubb %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
99 "paddb %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
100 "pcmpgtb %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
101 "paddb %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
102
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
103 "lea (%%"REG_a", %3, 4), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
104
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
105 "movq (%2, %3, 4), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
106 PMAXUB(%%mm2, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
107 PMINUB(%%mm2, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
108 "psubb %%mm2, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
109 "paddb %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
110 "pcmpgtb %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
111 "paddb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
112
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
113 "movq (%%"REG_a"), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
114 PMAXUB(%%mm1, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
115 PMINUB(%%mm1, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
116 "psubb %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
117 "paddb %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
118 "pcmpgtb %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
119 "paddb %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
120
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
121 "movq (%%"REG_a", %3), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
122 PMAXUB(%%mm2, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
123 PMINUB(%%mm2, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
124 "psubb %%mm2, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
125 "paddb %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
126 "pcmpgtb %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
127 "paddb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
128
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
129 "movq (%%"REG_a", %3, 2), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
130 PMAXUB(%%mm1, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
131 PMINUB(%%mm1, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
132 "psubb %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
133 "paddb %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
134 "pcmpgtb %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
135 "paddb %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
136 "psubusb %%mm3, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
137
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
138 " \n\t"
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
139 #if HAVE_MMX2
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
140 "pxor %%mm7, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
141 "psadbw %%mm7, %%mm0 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
142 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
143 "movq %%mm0, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
144 "psrlw $8, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
145 "paddb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
146 "movq %%mm0, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
147 "psrlq $16, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
148 "paddb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
149 "movq %%mm0, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
150 "psrlq $32, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
151 "paddb %%mm1, %%mm0 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
152 #endif
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
153 "movq %4, %%mm7 \n\t" // QP,..., QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
154 "paddusb %%mm7, %%mm7 \n\t" // 2QP ... 2QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
155 "psubusb %%mm7, %%mm4 \n\t" // Diff <= 2QP -> 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
156 "packssdw %%mm4, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
157 "movd %%mm0, %0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
158 "movd %%mm4, %1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
159
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
160 : "=r" (numEq), "=r" (dcOk)
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
161 : "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
162 : "%"REG_a
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
163 );
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
164
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
165 numEq= (-numEq) &0xFF;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
166 if(numEq > c->ppMode.flatnessThreshold){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
167 if(dcOk) return 0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
168 else return 1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
169 }else{
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
170 return 2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
171 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
172 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
173 #endif //HAVE_MMX
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
174
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
175 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
176 * Do a vertical low pass filter on the 8x16 block (only write to the 8x8 block in the middle)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
177 * using the 9-Tap Filter (1,1,2,2,4,2,2,1,1)/16
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
178 */
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
179 #if !HAVE_ALTIVEC
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
180 static inline void RENAME(doVertLowPass)(uint8_t *src, int stride, PPContext *c)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
181 {
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
182 #if HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
183 src+= stride*3;
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
184 __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
185 "movq %2, %%mm0 \n\t" // QP,..., QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
186 "pxor %%mm4, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
187
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
188 "movq (%0), %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
189 "movq (%0, %1), %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
190 "movq %%mm5, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
191 "movq %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
192 "psubusb %%mm6, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
193 "psubusb %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
194 "por %%mm5, %%mm2 \n\t" // ABS Diff of lines
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
195 "psubusb %%mm0, %%mm2 \n\t" // diff <= QP -> 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
196 "pcmpeqb %%mm4, %%mm2 \n\t" // diff <= QP -> FF
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
197
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
198 "pand %%mm2, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
199 "pandn %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
200 "por %%mm2, %%mm6 \n\t"// First Line to Filter
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
201
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
202 "movq (%0, %1, 8), %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
203 "lea (%0, %1, 4), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
204 "lea (%0, %1, 8), %%"REG_c" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
205 "sub %1, %%"REG_c" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
206 "add %1, %0 \n\t" // %0 points to line 1 not 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
207 "movq (%0, %1, 8), %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
208 "movq %%mm5, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
209 "movq %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
210 "psubusb %%mm7, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
211 "psubusb %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
212 "por %%mm5, %%mm2 \n\t" // ABS Diff of lines
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
213 "psubusb %%mm0, %%mm2 \n\t" // diff <= QP -> 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
214 "pcmpeqb %%mm4, %%mm2 \n\t" // diff <= QP -> FF
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
215
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
216 "pand %%mm2, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
217 "pandn %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
218 "por %%mm2, %%mm7 \n\t" // First Line to Filter
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
219
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
220
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
221 // 1 2 3 4 5 6 7 8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
222 // %0 %0+%1 %0+2%1 eax %0+4%1 eax+2%1 ecx eax+4%1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
223 // 6 4 2 2 1 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
224 // 6 4 4 2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
225 // 6 8 2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
226
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
227 "movq (%0, %1), %%mm0 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
228 "movq %%mm0, %%mm1 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
229 PAVGB(%%mm6, %%mm0) //1 1 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
230 PAVGB(%%mm6, %%mm0) //3 1 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
231
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
232 "movq (%0, %1, 4), %%mm2 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
233 "movq %%mm2, %%mm5 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
234 PAVGB((%%REGa), %%mm2) // 11 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
235 PAVGB((%0, %1, 2), %%mm2) // 211 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
236 "movq %%mm2, %%mm3 \n\t" // 211 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
237 "movq (%0), %%mm4 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
238 PAVGB(%%mm4, %%mm3) // 4 211 /8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
239 PAVGB(%%mm0, %%mm3) //642211 /16
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
240 "movq %%mm3, (%0) \n\t" // X
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
241 // mm1=2 mm2=3(211) mm4=1 mm5=5 mm6=0 mm7=9
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
242 "movq %%mm1, %%mm0 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
243 PAVGB(%%mm6, %%mm0) //1 1 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
244 "movq %%mm4, %%mm3 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
245 PAVGB((%0,%1,2), %%mm3) // 1 1 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
246 PAVGB((%%REGa,%1,2), %%mm5) // 11 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
247 PAVGB((%%REGa), %%mm5) // 211 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
248 PAVGB(%%mm5, %%mm3) // 2 2211 /8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
249 PAVGB(%%mm0, %%mm3) //4242211 /16
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
250 "movq %%mm3, (%0,%1) \n\t" // X
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
251 // mm1=2 mm2=3(211) mm4=1 mm5=4(211) mm6=0 mm7=9
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
252 PAVGB(%%mm4, %%mm6) //11 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
253 "movq (%%"REG_c"), %%mm0 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
254 PAVGB((%%REGa, %1, 2), %%mm0) // 11/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
255 "movq %%mm0, %%mm3 \n\t" // 11/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
256 PAVGB(%%mm1, %%mm0) // 2 11/4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
257 PAVGB(%%mm6, %%mm0) //222 11/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
258 PAVGB(%%mm2, %%mm0) //22242211/16
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
259 "movq (%0, %1, 2), %%mm2 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
260 "movq %%mm0, (%0, %1, 2) \n\t" // X
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
261 // mm1=2 mm2=3 mm3=6(11) mm4=1 mm5=4(211) mm6=0(11) mm7=9
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
262 "movq (%%"REG_a", %1, 4), %%mm0 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
263 PAVGB((%%REGc), %%mm0) // 11 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
264 PAVGB(%%mm0, %%mm6) //11 11 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
265 PAVGB(%%mm1, %%mm4) // 11 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
266 PAVGB(%%mm2, %%mm1) // 11 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
267 PAVGB(%%mm1, %%mm6) //1122 11 /8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
268 PAVGB(%%mm5, %%mm6) //112242211 /16
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
269 "movq (%%"REG_a"), %%mm5 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
270 "movq %%mm6, (%%"REG_a") \n\t" // X
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
271 // mm0=7(11) mm1=2(11) mm2=3 mm3=6(11) mm4=1(11) mm5=4 mm7=9
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
272 "movq (%%"REG_a", %1, 4), %%mm6 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
273 PAVGB(%%mm7, %%mm6) // 11 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
274 PAVGB(%%mm4, %%mm6) // 11 11 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
275 PAVGB(%%mm3, %%mm6) // 11 2211 /8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
276 PAVGB(%%mm5, %%mm2) // 11 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
277 "movq (%0, %1, 4), %%mm4 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
278 PAVGB(%%mm4, %%mm2) // 112 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
279 PAVGB(%%mm2, %%mm6) // 112242211 /16
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
280 "movq %%mm6, (%0, %1, 4) \n\t" // X
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
281 // mm0=7(11) mm1=2(11) mm2=3(112) mm3=6(11) mm4=5 mm5=4 mm7=9
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
282 PAVGB(%%mm7, %%mm1) // 11 2 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
283 PAVGB(%%mm4, %%mm5) // 11 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
284 PAVGB(%%mm5, %%mm0) // 11 11 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
285 "movq (%%"REG_a", %1, 2), %%mm6 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
286 PAVGB(%%mm6, %%mm1) // 11 4 2 /8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
287 PAVGB(%%mm0, %%mm1) // 11224222 /16
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
288 "movq %%mm1, (%%"REG_a", %1, 2) \n\t" // X
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
289 // mm2=3(112) mm3=6(11) mm4=5 mm5=4(11) mm6=6 mm7=9
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
290 PAVGB((%%REGc), %%mm2) // 112 4 /8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
291 "movq (%%"REG_a", %1, 4), %%mm0 \n\t" // 1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
292 PAVGB(%%mm0, %%mm6) // 1 1 /2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
293 PAVGB(%%mm7, %%mm6) // 1 12 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
294 PAVGB(%%mm2, %%mm6) // 1122424 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
295 "movq %%mm6, (%%"REG_c") \n\t" // X
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
296 // mm0=8 mm3=6(11) mm4=5 mm5=4(11) mm7=9
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
297 PAVGB(%%mm7, %%mm5) // 11 2 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
298 PAVGB(%%mm7, %%mm5) // 11 6 /8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
299
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
300 PAVGB(%%mm3, %%mm0) // 112 /4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
301 PAVGB(%%mm0, %%mm5) // 112246 /16
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
302 "movq %%mm5, (%%"REG_a", %1, 4) \n\t" // X
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
303 "sub %1, %0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
304
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
305 :
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
306 : "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
307 : "%"REG_a, "%"REG_c
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
308 );
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
309 #else //HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
310 const int l1= stride;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
311 const int l2= stride + l1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
312 const int l3= stride + l2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
313 const int l4= stride + l3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
314 const int l5= stride + l4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
315 const int l6= stride + l5;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
316 const int l7= stride + l6;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
317 const int l8= stride + l7;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
318 const int l9= stride + l8;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
319 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
320 src+= stride*3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
321 for(x=0; x<BLOCK_SIZE; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
322 const int first= FFABS(src[0] - src[l1]) < c->QP ? src[0] : src[l1];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
323 const int last= FFABS(src[l8] - src[l9]) < c->QP ? src[l9] : src[l8];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
324
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
325 int sums[10];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
326 sums[0] = 4*first + src[l1] + src[l2] + src[l3] + 4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
327 sums[1] = sums[0] - first + src[l4];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
328 sums[2] = sums[1] - first + src[l5];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
329 sums[3] = sums[2] - first + src[l6];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
330 sums[4] = sums[3] - first + src[l7];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
331 sums[5] = sums[4] - src[l1] + src[l8];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
332 sums[6] = sums[5] - src[l2] + last;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
333 sums[7] = sums[6] - src[l3] + last;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
334 sums[8] = sums[7] - src[l4] + last;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
335 sums[9] = sums[8] - src[l5] + last;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
336
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
337 src[l1]= (sums[0] + sums[2] + 2*src[l1])>>4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
338 src[l2]= (sums[1] + sums[3] + 2*src[l2])>>4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
339 src[l3]= (sums[2] + sums[4] + 2*src[l3])>>4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
340 src[l4]= (sums[3] + sums[5] + 2*src[l4])>>4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
341 src[l5]= (sums[4] + sums[6] + 2*src[l5])>>4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
342 src[l6]= (sums[5] + sums[7] + 2*src[l6])>>4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
343 src[l7]= (sums[6] + sums[8] + 2*src[l7])>>4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
344 src[l8]= (sums[7] + sums[9] + 2*src[l8])>>4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
345
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
346 src++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
347 }
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
348 #endif //HAVE_MMX2 || HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
349 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
350 #endif //HAVE_ALTIVEC
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
351
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
352 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
353 * Experimental Filter 1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
354 * will not damage linear gradients
90
8e738e0a16f5 typo fixes
diego
parents: 78
diff changeset
355 * Flat blocks should look like they were passed through the (1,1,2,2,4,2,2,1,1) 9-Tap filter
48
72675332ed82 misc spelling fixes
diego
parents: 45
diff changeset
356 * can only smooth blocks at the expected locations (it cannot smooth them if they did move)
72675332ed82 misc spelling fixes
diego
parents: 45
diff changeset
357 * MMX2 version does correct clipping C version does not
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
358 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
359 static inline void RENAME(vertX1Filter)(uint8_t *src, int stride, PPContext *co)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
360 {
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
361 #if HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
362 src+= stride*3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
363
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
364 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
365 "pxor %%mm7, %%mm7 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
366 "lea (%0, %1), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
367 "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
368 // 0 1 2 3 4 5 6 7 8 9
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
369 // %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
370 "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
371 "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
372 "movq %%mm1, %%mm2 \n\t" // line 4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
373 "psubusb %%mm0, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
374 "psubusb %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
375 "por %%mm1, %%mm0 \n\t" // |l2 - l3|
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
376 "movq (%%"REG_c"), %%mm3 \n\t" // line 5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
377 "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
378 "movq %%mm3, %%mm5 \n\t" // line 5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
379 "psubusb %%mm4, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
380 "psubusb %%mm5, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
381 "por %%mm4, %%mm3 \n\t" // |l5 - l6|
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
382 PAVGB(%%mm3, %%mm0) // (|l2 - l3| + |l5 - l6|)/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
383 "movq %%mm2, %%mm1 \n\t" // line 4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
384 "psubusb %%mm5, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
385 "movq %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
386 "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
387 "psubusb %%mm1, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
388 "por %%mm5, %%mm4 \n\t" // |l4 - l5|
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
389 "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
390 "movq %%mm4, %%mm3 \n\t" // d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
391 "movq %2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
392 "paddusb %%mm0, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
393 "psubusb %%mm0, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
394 "pcmpeqb %%mm7, %%mm4 \n\t" // d <= QP ? -1 : 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
395 "psubusb "MANGLE(b01)", %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
396 "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
397
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
398 PAVGB(%%mm7, %%mm3) // d/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
399 "movq %%mm3, %%mm1 \n\t" // d/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
400 PAVGB(%%mm7, %%mm3) // d/4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
401 PAVGB(%%mm1, %%mm3) // 3*d/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
402
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
403 "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
404 "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
405 "psubusb %%mm3, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
406 "pxor %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
407 "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
408
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
409 "movq (%%"REG_c"), %%mm0 \n\t" // line 5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
410 "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
411 "paddusb %%mm3, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
412 "pxor %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
413 "movq %%mm0, (%%"REG_c") \n\t" // line 5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
414
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
415 PAVGB(%%mm7, %%mm1) // d/4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
416
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
417 "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
418 "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
419 "psubusb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
420 "pxor %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
421 "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
422
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
423 "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
424 "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
425 "paddusb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
426 "pxor %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
427 "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
428
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
429 PAVGB(%%mm7, %%mm1) // d/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
430
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
431 "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
432 "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
433 "psubusb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
434 "pxor %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
435 "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
436
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
437 "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
438 "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
439 "paddusb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
440 "pxor %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
441 "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
442
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
443 :
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
444 : "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
445 : "%"REG_a, "%"REG_c
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
446 );
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
447 #else //HAVE_MMX2 || HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
448
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
449 const int l1= stride;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
450 const int l2= stride + l1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
451 const int l3= stride + l2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
452 const int l4= stride + l3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
453 const int l5= stride + l4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
454 const int l6= stride + l5;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
455 const int l7= stride + l6;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
456 // const int l8= stride + l7;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
457 // const int l9= stride + l8;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
458 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
459
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
460 src+= stride*3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
461 for(x=0; x<BLOCK_SIZE; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
462 int a= src[l3] - src[l4];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
463 int b= src[l4] - src[l5];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
464 int c= src[l5] - src[l6];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
465
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
466 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
467 d= FFMAX(d, 0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
468
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
469 if(d < co->QP*2){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
470 int v = d * FFSIGN(-b);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
471
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
472 src[l2] +=v>>3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
473 src[l3] +=v>>2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
474 src[l4] +=(3*v)>>3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
475 src[l5] -=(3*v)>>3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
476 src[l6] -=v>>2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
477 src[l7] -=v>>3;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
478 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
479 src++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
480 }
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
481 #endif //HAVE_MMX2 || HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
482 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
483
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
484 #if !HAVE_ALTIVEC
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
485 static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext *c)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
486 {
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
487 #if HAVE_MMX2 || HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
488 /*
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
489 uint8_t tmp[16];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
490 const int l1= stride;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
491 const int l2= stride + l1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
492 const int l3= stride + l2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
493 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
494 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
495 const int l6= stride*3 + l3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
496 const int l7= stride + l6;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
497 const int l8= stride + l7;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
498
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
499 memcpy(tmp, src+stride*7, 8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
500 memcpy(tmp+8, src+stride*8, 8);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
501 */
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
502 src+= stride*4;
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
503 __asm__ volatile(
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
504
97
2653d9f33b8a cosmetics: typo fixes
diego
parents: 96
diff changeset
505 #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
506 "pxor %%mm7, %%mm7 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
507 "lea (%0, %1), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
508 "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
509 // 0 1 2 3 4 5 6 7
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
510 // %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 ecx+%1 ecx+2%1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
511 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
512
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
513
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
514 "movq (%0, %1, 2), %%mm0 \n\t" // l2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
515 "movq (%0), %%mm1 \n\t" // l0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
516 "movq %%mm0, %%mm2 \n\t" // l2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
517 PAVGB(%%mm7, %%mm0) // ~l2/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
518 PAVGB(%%mm1, %%mm0) // ~(l2 + 2l0)/4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
519 PAVGB(%%mm2, %%mm0) // ~(5l2 + 2l0)/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
520
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
521 "movq (%%"REG_a"), %%mm1 \n\t" // l1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
522 "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
523 "movq %%mm1, %%mm4 \n\t" // l1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
524 PAVGB(%%mm7, %%mm1) // ~l1/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
525 PAVGB(%%mm3, %%mm1) // ~(l1 + 2l3)/4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
526 PAVGB(%%mm4, %%mm1) // ~(5l1 + 2l3)/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
527
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
528 "movq %%mm0, %%mm4 \n\t" // ~(5l2 + 2l0)/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
529 "psubusb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
530 "psubusb %%mm4, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
531 "por %%mm0, %%mm1 \n\t" // ~|2l0 - 5l1 + 5l2 - 2l3|/8
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
532 // mm1= |lenergy|, mm2= l2, mm3= l3, mm7=0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
533
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
534 "movq (%0, %1, 4), %%mm0 \n\t" // l4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
535 "movq %%mm0, %%mm4 \n\t" // l4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
536 PAVGB(%%mm7, %%mm0) // ~l4/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
537 PAVGB(%%mm2, %%mm0) // ~(l4 + 2l2)/4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
538 PAVGB(%%mm4, %%mm0) // ~(5l4 + 2l2)/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
539
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
540 "movq (%%"REG_c"), %%mm2 \n\t" // l5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
541 "movq %%mm3, %%mm5 \n\t" // l3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
542 PAVGB(%%mm7, %%mm3) // ~l3/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
543 PAVGB(%%mm2, %%mm3) // ~(l3 + 2l5)/4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
544 PAVGB(%%mm5, %%mm3) // ~(5l3 + 2l5)/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
545
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
546 "movq %%mm0, %%mm6 \n\t" // ~(5l4 + 2l2)/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
547 "psubusb %%mm3, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
548 "psubusb %%mm6, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
549 "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
550 "pcmpeqb %%mm7, %%mm0 \n\t" // SIGN(2l2 - 5l3 + 5l4 - 2l5)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
551 // mm0= SIGN(menergy), mm1= |lenergy|, mm2= l5, mm3= |menergy|, mm4=l4, mm5= l3, mm7=0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
552
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
553 "movq (%%"REG_c", %1), %%mm6 \n\t" // l6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
554 "movq %%mm6, %%mm5 \n\t" // l6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
555 PAVGB(%%mm7, %%mm6) // ~l6/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
556 PAVGB(%%mm4, %%mm6) // ~(l6 + 2l4)/4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
557 PAVGB(%%mm5, %%mm6) // ~(5l6 + 2l4)/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
558
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
559 "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
560 "movq %%mm2, %%mm4 \n\t" // l5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
561 PAVGB(%%mm7, %%mm2) // ~l5/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
562 PAVGB(%%mm5, %%mm2) // ~(l5 + 2l7)/4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
563 PAVGB(%%mm4, %%mm2) // ~(5l5 + 2l7)/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
564
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
565 "movq %%mm6, %%mm4 \n\t" // ~(5l6 + 2l4)/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
566 "psubusb %%mm2, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
567 "psubusb %%mm4, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
568 "por %%mm6, %%mm2 \n\t" // ~|2l4 - 5l5 + 5l6 - 2l7|/8
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
569 // mm0= SIGN(menergy), mm1= |lenergy|/8, mm2= |renergy|/8, mm3= |menergy|/8, mm7=0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
570
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
571
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
572 PMINUB(%%mm2, %%mm1, %%mm4) // MIN(|lenergy|,|renergy|)/8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
573 "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
574 "paddusb "MANGLE(b01)", %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
575 "pcmpgtb %%mm3, %%mm4 \n\t" // |menergy|/8 < QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
576 "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
577 "pand %%mm4, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
578
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
579 "movq %%mm3, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
580 // "psubusb "MANGLE(b01)", %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
581 PAVGB(%%mm7, %%mm3)
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 "paddusb %%mm1, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
584 // "paddusb "MANGLE(b01)", %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
585
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
586 "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
587 "movq (%0, %1, 4), %%mm5 \n\t" //l4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
588 "movq (%0, %1, 4), %%mm4 \n\t" //l4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
589 "psubusb %%mm6, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
590 "psubusb %%mm4, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
591 "por %%mm6, %%mm5 \n\t" // |l3-l4|
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
592 "pcmpeqb %%mm7, %%mm6 \n\t" // SIGN(l3-l4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
593 "pxor %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
594 "pand %%mm0, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
595 PMINUB(%%mm5, %%mm3, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
596
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
597 "psubusb "MANGLE(b01)", %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
598 PAVGB(%%mm7, %%mm3)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
599
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
600 "movq (%%"REG_a", %1, 2), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
601 "movq (%0, %1, 4), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
602 "pxor %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
603 "pxor %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
604 "psubb %%mm3, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
605 "paddb %%mm3, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
606 "pxor %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
607 "pxor %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
608 "movq %%mm0, (%%"REG_a", %1, 2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
609 "movq %%mm2, (%0, %1, 4) \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
610 #endif //0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
611
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
612 "lea (%0, %1), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
613 "pcmpeqb %%mm6, %%mm6 \n\t" // -1
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
614 // 0 1 2 3 4 5 6 7
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
615 // %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 ecx+%1 ecx+2%1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
616 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
617
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
618
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
619 "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
620 "movq (%0, %1, 4), %%mm0 \n\t" // l4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
621 "pxor %%mm6, %%mm1 \n\t" // -l3-1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
622 PAVGB(%%mm1, %%mm0) // -q+128 = (l4-l3+256)/2
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
623 // mm1=-l3-1, mm0=128-q
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
624
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
625 "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
626 "movq (%%"REG_a", %1), %%mm3 \n\t" // l2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
627 "pxor %%mm6, %%mm2 \n\t" // -l5-1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
628 "movq %%mm2, %%mm5 \n\t" // -l5-1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
629 "movq "MANGLE(b80)", %%mm4 \n\t" // 128
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
630 "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
631 PAVGB(%%mm3, %%mm2) // (l2-l5+256)/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
632 PAVGB(%%mm0, %%mm4) // ~(l4-l3)/4 + 128
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
633 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
634 PAVGB(%%mm0, %%mm4) // ~(l2-l5)/8 +5(l4-l3)/16 + 128
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
635 // mm1=-l3-1, mm0=128-q, mm3=l2, mm4=menergy/16 + 128, mm5= -l5-1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
636
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
637 "movq (%%"REG_a"), %%mm2 \n\t" // l1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
638 "pxor %%mm6, %%mm2 \n\t" // -l1-1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
639 PAVGB(%%mm3, %%mm2) // (l2-l1+256)/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
640 PAVGB((%0), %%mm1) // (l0-l3+256)/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
641 "movq "MANGLE(b80)", %%mm3 \n\t" // 128
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
642 PAVGB(%%mm2, %%mm3) // ~(l2-l1)/4 + 128
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
643 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
644 PAVGB(%%mm2, %%mm3) // ~(l0-l3)/8 +5(l2-l1)/16 + 128
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
645 // mm0=128-q, mm3=lenergy/16 + 128, mm4= menergy/16 + 128, mm5= -l5-1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
646
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
647 PAVGB((%%REGc, %1), %%mm5) // (l6-l5+256)/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
648 "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
649 "pxor %%mm6, %%mm1 \n\t" // -l7-1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
650 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
651 "movq "MANGLE(b80)", %%mm2 \n\t" // 128
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
652 PAVGB(%%mm5, %%mm2) // ~(l6-l5)/4 + 128
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
653 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
654 PAVGB(%%mm5, %%mm2) // ~(l4-l7)/8 +5(l6-l5)/16 + 128
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
655 // mm0=128-q, mm2=renergy/16 + 128, mm3=lenergy/16 + 128, mm4= menergy/16 + 128
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
656
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
657 "movq "MANGLE(b00)", %%mm1 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
658 "movq "MANGLE(b00)", %%mm5 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
659 "psubb %%mm2, %%mm1 \n\t" // 128 - renergy/16
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
660 "psubb %%mm3, %%mm5 \n\t" // 128 - lenergy/16
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
661 PMAXUB(%%mm1, %%mm2) // 128 + |renergy/16|
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
662 PMAXUB(%%mm5, %%mm3) // 128 + |lenergy/16|
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
663 PMINUB(%%mm2, %%mm3, %%mm1) // 128 + MIN(|lenergy|,|renergy|)/16
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
664
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
665 // mm0=128-q, mm3=128 + MIN(|lenergy|,|renergy|)/16, mm4= menergy/16 + 128
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
666
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
667 "movq "MANGLE(b00)", %%mm7 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
668 "movq %2, %%mm2 \n\t" // QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
669 PAVGB(%%mm6, %%mm2) // 128 + QP/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
670 "psubb %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
671
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
672 "movq %%mm4, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
673 "pcmpgtb %%mm7, %%mm1 \n\t" // SIGN(menergy)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
674 "pxor %%mm1, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
675 "psubb %%mm1, %%mm4 \n\t" // 128 + |menergy|/16
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
676 "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
677 "psubusb %%mm3, %%mm4 \n\t" //d=|menergy|/16 - MIN(|lenergy|,|renergy|)/16
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
678 // mm0=128-q, mm1= SIGN(menergy), mm2= |menergy|/16 < QP/2, mm4= d/16
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
679
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
680 "movq %%mm4, %%mm3 \n\t" // d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
681 "psubusb "MANGLE(b01)", %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
682 PAVGB(%%mm7, %%mm4) // d/32
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
683 PAVGB(%%mm7, %%mm4) // (d + 32)/64
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
684 "paddb %%mm3, %%mm4 \n\t" // 5d/64
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
685 "pand %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
686
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
687 "movq "MANGLE(b80)", %%mm5 \n\t" // 128
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
688 "psubb %%mm0, %%mm5 \n\t" // q
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
689 "paddsb %%mm6, %%mm5 \n\t" // fix bad rounding
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
690 "pcmpgtb %%mm5, %%mm7 \n\t" // SIGN(q)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
691 "pxor %%mm7, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
692
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
693 PMINUB(%%mm5, %%mm4, %%mm3) // MIN(|q|, 5d/64)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
694 "pxor %%mm1, %%mm7 \n\t" // SIGN(d*q)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
695
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
696 "pand %%mm7, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
697 "movq (%%"REG_a", %1, 2), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
698 "movq (%0, %1, 4), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
699 "pxor %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
700 "pxor %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
701 "paddb %%mm4, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
702 "psubb %%mm4, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
703 "pxor %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
704 "pxor %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
705 "movq %%mm0, (%%"REG_a", %1, 2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
706 "movq %%mm2, (%0, %1, 4) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
707
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
708 :
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
709 : "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
710 : "%"REG_a, "%"REG_c
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
711 );
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
712
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
713 /*
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
714 {
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
715 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
716 src-= stride;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
717 for(x=0; x<BLOCK_SIZE; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
718 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
719 if(FFABS(middleEnergy)< 8*QP){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
720 const int q=(src[l4] - src[l5])/2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
721 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
722 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
723
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
724 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
725 d= FFMAX(d, 0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
726
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
727 d= (5*d + 32) >> 6;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
728 d*= FFSIGN(-middleEnergy);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
729
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
730 if(q>0){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
731 d= d<0 ? 0 : d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
732 d= d>q ? q : d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
733 }else{
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
734 d= d>0 ? 0 : d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
735 d= d<q ? q : d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
736 }
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 src[l4]-= d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
739 src[l5]+= d;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
740 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
741 src++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
742 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
743 src-=8;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
744 for(x=0; x<8; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
745 int y;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
746 for(y=4; y<6; y++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
747 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
748 int ad= FFABS(d);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
749 static int max=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
750 static int sum=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
751 static int num=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
752 static int bias=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
753
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
754 if(max<ad) max=ad;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
755 sum+= ad>3 ? 1 : 0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
756 if(ad>3){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
757 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
758 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
759 if(y==4) bias+=d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
760 num++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
761 if(num%1000000 == 0){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
762 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
763 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
764 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
765 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
766 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
767 */
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
768 #elif HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
769 src+= stride*4;
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
770 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
771 "pxor %%mm7, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
772 "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
773 "and "ALIGN_MASK", %%"REG_c" \n\t" // align
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
774 // 0 1 2 3 4 5 6 7
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
775 // %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 edx+%1 edx+2%1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
776 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
777
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
778 "movq (%0), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
779 "movq %%mm0, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
780 "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
781 "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
782
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
783 "movq (%0, %1), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
784 "lea (%0, %1, 2), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
785 "movq %%mm2, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
786 "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
787 "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
788
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
789 "movq (%%"REG_a"), %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
790 "movq %%mm4, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
791 "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
792 "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
793
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
794 "paddw %%mm0, %%mm0 \n\t" // 2L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
795 "paddw %%mm1, %%mm1 \n\t" // 2H0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
796 "psubw %%mm4, %%mm2 \n\t" // L1 - L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
797 "psubw %%mm5, %%mm3 \n\t" // H1 - H2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
798 "psubw %%mm2, %%mm0 \n\t" // 2L0 - L1 + L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
799 "psubw %%mm3, %%mm1 \n\t" // 2H0 - H1 + H2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
800
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
801 "psllw $2, %%mm2 \n\t" // 4L1 - 4L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
802 "psllw $2, %%mm3 \n\t" // 4H1 - 4H2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
803 "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
804 "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
805
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
806 "movq (%%"REG_a", %1), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
807 "movq %%mm2, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
808 "punpcklbw %%mm7, %%mm2 \n\t" // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
809 "punpckhbw %%mm7, %%mm3 \n\t" // H3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
810
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
811 "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
812 "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
813 "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
814 "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
815 "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
816 "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
817
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
818 "movq (%%"REG_a", %1, 2), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
819 "movq %%mm0, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
820 "punpcklbw %%mm7, %%mm0 \n\t" // L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
821 "punpckhbw %%mm7, %%mm1 \n\t" // H4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
822
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
823 "psubw %%mm0, %%mm2 \n\t" // L3 - L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
824 "psubw %%mm1, %%mm3 \n\t" // H3 - H4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
825 "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
826 "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
827 "paddw %%mm4, %%mm4 \n\t" // 2L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
828 "paddw %%mm5, %%mm5 \n\t" // 2H2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
829 "psubw %%mm2, %%mm4 \n\t" // 2L2 - L3 + L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
830 "psubw %%mm3, %%mm5 \n\t" // 2H2 - H3 + H4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
831
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
832 "lea (%%"REG_a", %1), %0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
833 "psllw $2, %%mm2 \n\t" // 4L3 - 4L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
834 "psllw $2, %%mm3 \n\t" // 4H3 - 4H4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
835 "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
836 "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
837 //50 opcodes so far
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
838 "movq (%0, %1, 2), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
839 "movq %%mm2, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
840 "punpcklbw %%mm7, %%mm2 \n\t" // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
841 "punpckhbw %%mm7, %%mm3 \n\t" // H5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
842 "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
843 "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
844 "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
845 "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
846
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
847 "movq (%%"REG_a", %1, 4), %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
848 "punpcklbw %%mm7, %%mm6 \n\t" // L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
849 "psubw %%mm6, %%mm2 \n\t" // L5 - L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
850 "movq (%%"REG_a", %1, 4), %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
851 "punpckhbw %%mm7, %%mm6 \n\t" // H6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
852 "psubw %%mm6, %%mm3 \n\t" // H5 - H6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
853
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
854 "paddw %%mm0, %%mm0 \n\t" // 2L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
855 "paddw %%mm1, %%mm1 \n\t" // 2H4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
856 "psubw %%mm2, %%mm0 \n\t" // 2L4 - L5 + L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
857 "psubw %%mm3, %%mm1 \n\t" // 2H4 - H5 + H6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
858
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
859 "psllw $2, %%mm2 \n\t" // 4L5 - 4L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
860 "psllw $2, %%mm3 \n\t" // 4H5 - 4H6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
861 "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
862 "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
863
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
864 "movq (%0, %1, 4), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
865 "movq %%mm2, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
866 "punpcklbw %%mm7, %%mm2 \n\t" // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
867 "punpckhbw %%mm7, %%mm3 \n\t" // H7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
868
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
869 "paddw %%mm2, %%mm2 \n\t" // 2L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
870 "paddw %%mm3, %%mm3 \n\t" // 2H7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
871 "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
872 "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
873
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
874 "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
875 "movq 8(%%"REG_c"), %%mm3 \n\t" // 2H0 - 5H1 + 5H2 - 2H3
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
876
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
877 #if HAVE_MMX2
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
878 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
879 "psubw %%mm0, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
880 "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
881 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
882 "psubw %%mm1, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
883 "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
884 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
885 "psubw %%mm2, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
886 "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
887 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
888 "psubw %%mm3, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
889 "pmaxsw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3|
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
890 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
891 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
892 "pcmpgtw %%mm0, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
893 "pxor %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
894 "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
895 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
896 "pcmpgtw %%mm1, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
897 "pxor %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
898 "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
899 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
900 "pcmpgtw %%mm2, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
901 "pxor %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
902 "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
903 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
904 "pcmpgtw %%mm3, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
905 "pxor %%mm6, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
906 "psubw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3|
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
907 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
908
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
909 #if HAVE_MMX2
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
910 "pminsw %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
911 "pminsw %%mm3, %%mm1 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
912 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
913 "movq %%mm0, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
914 "psubusw %%mm2, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
915 "psubw %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
916 "movq %%mm1, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
917 "psubusw %%mm3, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
918 "psubw %%mm6, %%mm1 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
919 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
920
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
921 "movd %2, %%mm2 \n\t" // QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
922 "punpcklbw %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
923
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
924 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
925 "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
926 "pxor %%mm6, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
927 "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
928 "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
929 "pxor %%mm7, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
930 "psubw %%mm7, %%mm5 \n\t" // |2H2 - 5H3 + 5H4 - 2H5|
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
931 // 100 opcodes
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
932 "psllw $3, %%mm2 \n\t" // 8QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
933 "movq %%mm2, %%mm3 \n\t" // 8QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
934 "pcmpgtw %%mm4, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
935 "pcmpgtw %%mm5, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
936 "pand %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
937 "pand %%mm3, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
938
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 "psubusw %%mm0, %%mm4 \n\t" // hd
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
941 "psubusw %%mm1, %%mm5 \n\t" // ld
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
942
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 "movq "MANGLE(w05)", %%mm2 \n\t" // 5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
945 "pmullw %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
946 "pmullw %%mm2, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
947 "movq "MANGLE(w20)", %%mm2 \n\t" // 32
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
948 "paddw %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
949 "paddw %%mm2, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
950 "psrlw $6, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
951 "psrlw $6, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
952
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
953 "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
954 "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
955
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
956 "pxor %%mm2, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
957 "pxor %%mm3, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
958
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
959 "pcmpgtw %%mm0, %%mm2 \n\t" // sign (L3-L4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
960 "pcmpgtw %%mm1, %%mm3 \n\t" // sign (H3-H4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
961 "pxor %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
962 "pxor %%mm3, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
963 "psubw %%mm2, %%mm0 \n\t" // |L3-L4|
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
964 "psubw %%mm3, %%mm1 \n\t" // |H3-H4|
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
965 "psrlw $1, %%mm0 \n\t" // |L3 - L4|/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
966 "psrlw $1, %%mm1 \n\t" // |H3 - H4|/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
967
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
968 "pxor %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
969 "pxor %%mm7, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
970 "pand %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
971 "pand %%mm3, %%mm5 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
972
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
973 #if HAVE_MMX2
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
974 "pminsw %%mm0, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
975 "pminsw %%mm1, %%mm5 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
976 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
977 "movq %%mm4, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
978 "psubusw %%mm0, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
979 "psubw %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
980 "movq %%mm5, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
981 "psubusw %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
982 "psubw %%mm2, %%mm5 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
983 #endif
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
984 "pxor %%mm6, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
985 "pxor %%mm7, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
986 "psubw %%mm6, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
987 "psubw %%mm7, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
988 "packsswb %%mm5, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
989 "movq (%0), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
990 "paddb %%mm4, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
991 "movq %%mm0, (%0) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
992 "movq (%0, %1), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
993 "psubb %%mm4, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
994 "movq %%mm0, (%0, %1) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
995
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
996 : "+r" (src)
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
997 : "r" ((x86_reg)stride), "m" (c->pQPb)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
998 : "%"REG_a, "%"REG_c
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
999 );
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1000 #else //HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1001 const int l1= stride;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1002 const int l2= stride + l1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1003 const int l3= stride + l2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1004 const int l4= stride + l3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1005 const int l5= stride + l4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1006 const int l6= stride + l5;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1007 const int l7= stride + l6;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1008 const int l8= stride + l7;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1009 // const int l9= stride + l8;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1010 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1011 src+= stride*3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1012 for(x=0; x<BLOCK_SIZE; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1013 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
1014 if(FFABS(middleEnergy) < 8*c->QP){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1015 const int q=(src[l4] - src[l5])/2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1016 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
1017 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
1018
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1019 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
1020 d= FFMAX(d, 0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1021
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1022 d= (5*d + 32) >> 6;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1023 d*= FFSIGN(-middleEnergy);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1024
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1025 if(q>0){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1026 d= d<0 ? 0 : d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1027 d= d>q ? q : d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1028 }else{
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1029 d= d>0 ? 0 : d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1030 d= d<q ? q : d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1031 }
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 src[l4]-= d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1034 src[l5]+= d;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1035 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1036 src++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1037 }
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1038 #endif //HAVE_MMX2 || HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1039 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1040 #endif //HAVE_ALTIVEC
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1041
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
1042 #if !HAVE_ALTIVEC
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1043 static inline void RENAME(dering)(uint8_t src[], int stride, PPContext *c)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1044 {
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1045 #if HAVE_MMX2 || HAVE_AMD3DNOW
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
1046 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1047 "pxor %%mm6, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1048 "pcmpeqb %%mm7, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1049 "movq %2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1050 "punpcklbw %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1051 "psrlw $1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1052 "psubw %%mm7, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1053 "packuswb %%mm0, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1054 "movq %%mm0, %3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1055
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1056 "lea (%0, %1), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1057 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1058
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1059 // 0 1 2 3 4 5 6 7 8 9
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1060 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1061
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1062 #undef FIND_MIN_MAX
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
1063 #if HAVE_MMX2
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1064 #define REAL_FIND_MIN_MAX(addr)\
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1065 "movq " #addr ", %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1066 "pminub %%mm0, %%mm7 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1067 "pmaxub %%mm0, %%mm6 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1068 #else
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1069 #define REAL_FIND_MIN_MAX(addr)\
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1070 "movq " #addr ", %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1071 "movq %%mm7, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1072 "psubusb %%mm0, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1073 "paddb %%mm0, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1074 "psubusb %%mm0, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1075 "psubb %%mm1, %%mm7 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1076 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1077 #define FIND_MIN_MAX(addr) REAL_FIND_MIN_MAX(addr)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1078
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1079 FIND_MIN_MAX((%%REGa))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1080 FIND_MIN_MAX((%%REGa, %1))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1081 FIND_MIN_MAX((%%REGa, %1, 2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1082 FIND_MIN_MAX((%0, %1, 4))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1083 FIND_MIN_MAX((%%REGd))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1084 FIND_MIN_MAX((%%REGd, %1))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1085 FIND_MIN_MAX((%%REGd, %1, 2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1086 FIND_MIN_MAX((%0, %1, 8))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1087
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1088 "movq %%mm7, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1089 "psrlq $8, %%mm7 \n\t"
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
1090 #if HAVE_MMX2
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1091 "pminub %%mm4, %%mm7 \n\t" // min of pixels
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1092 "pshufw $0xF9, %%mm7, %%mm4 \n\t"
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 $0xFE, %%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"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1096 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1097 "movq %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1098 "psubusb %%mm4, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1099 "psubb %%mm1, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1100 "movq %%mm7, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1101 "psrlq $16, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1102 "movq %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1103 "psubusb %%mm4, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1104 "psubb %%mm1, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1105 "movq %%mm7, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1106 "psrlq $32, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1107 "movq %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1108 "psubusb %%mm4, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1109 "psubb %%mm1, %%mm7 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1110 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1111
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1112
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1113 "movq %%mm6, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1114 "psrlq $8, %%mm6 \n\t"
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
1115 #if HAVE_MMX2
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1116 "pmaxub %%mm4, %%mm6 \n\t" // max of pixels
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1117 "pshufw $0xF9, %%mm6, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1118 "pmaxub %%mm4, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1119 "pshufw $0xFE, %%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"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1121 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1122 "psubusb %%mm4, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1123 "paddb %%mm4, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1124 "movq %%mm6, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1125 "psrlq $16, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1126 "psubusb %%mm4, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1127 "paddb %%mm4, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1128 "movq %%mm6, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1129 "psrlq $32, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1130 "psubusb %%mm4, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1131 "paddb %%mm4, %%mm6 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1132 #endif
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1133 "movq %%mm6, %%mm0 \n\t" // max
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1134 "psubb %%mm7, %%mm6 \n\t" // max - min
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1135 "movd %%mm6, %%ecx \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1136 "cmpb "MANGLE(deringThreshold)", %%cl \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1137 " jb 1f \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1138 "lea -24(%%"REG_SP"), %%"REG_c" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1139 "and "ALIGN_MASK", %%"REG_c" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1140 PAVGB(%%mm0, %%mm7) // a=(max + min)/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1141 "punpcklbw %%mm7, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1142 "punpcklbw %%mm7, %%mm7 \n\t"
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 "movq %%mm7, (%%"REG_c") \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1145
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1146 "movq (%0), %%mm0 \n\t" // L10
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1147 "movq %%mm0, %%mm1 \n\t" // L10
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1148 "movq %%mm0, %%mm2 \n\t" // L10
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1149 "psllq $8, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1150 "psrlq $8, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1151 "movd -4(%0), %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1152 "movd 8(%0), %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1153 "psrlq $24, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1154 "psllq $56, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1155 "por %%mm3, %%mm1 \n\t" // L00
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1156 "por %%mm4, %%mm2 \n\t" // L20
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1157 "movq %%mm1, %%mm3 \n\t" // L00
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1158 PAVGB(%%mm2, %%mm1) // (L20 + L00)/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1159 PAVGB(%%mm0, %%mm1) // (L20 + L00 + 2L10)/4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1160 "psubusb %%mm7, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1161 "psubusb %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1162 "psubusb %%mm7, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1163 "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
1164 "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
1165 "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
1166 "paddb %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1167 "paddb %%mm3, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1168
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1169 "movq (%%"REG_a"), %%mm2 \n\t" // L11
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1170 "movq %%mm2, %%mm3 \n\t" // L11
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1171 "movq %%mm2, %%mm4 \n\t" // L11
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1172 "psllq $8, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1173 "psrlq $8, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1174 "movd -4(%%"REG_a"), %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1175 "movd 8(%%"REG_a"), %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1176 "psrlq $24, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1177 "psllq $56, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1178 "por %%mm5, %%mm3 \n\t" // L01
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1179 "por %%mm6, %%mm4 \n\t" // L21
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1180 "movq %%mm3, %%mm5 \n\t" // L01
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1181 PAVGB(%%mm4, %%mm3) // (L21 + L01)/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1182 PAVGB(%%mm2, %%mm3) // (L21 + L01 + 2L11)/4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1183 "psubusb %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1184 "psubusb %%mm7, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1185 "psubusb %%mm7, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1186 "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
1187 "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
1188 "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
1189 "paddb %%mm4, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1190 "paddb %%mm5, %%mm2 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1191 // 0, 2, 3, 1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1192 #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
1193 "movq " #src ", " #sx " \n\t" /* src[0] */\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1194 "movq " #sx ", " #lx " \n\t" /* src[0] */\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1195 "movq " #sx ", " #t0 " \n\t" /* src[0] */\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1196 "psllq $8, " #lx " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1197 "psrlq $8, " #t0 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1198 "movd -4" #src ", " #t1 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1199 "psrlq $24, " #t1 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1200 "por " #t1 ", " #lx " \n\t" /* src[-1] */\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1201 "movd 8" #src ", " #t1 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1202 "psllq $56, " #t1 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1203 "por " #t1 ", " #t0 " \n\t" /* src[+1] */\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1204 "movq " #lx ", " #t1 " \n\t" /* src[-1] */\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1205 PAVGB(t0, lx) /* (src[-1] + src[+1])/2 */\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1206 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
1207 PAVGB(lx, pplx) \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1208 "movq " #lx ", 8(%%"REG_c") \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1209 "movq (%%"REG_c"), " #lx " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1210 "psubusb " #lx ", " #t1 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1211 "psubusb " #lx ", " #t0 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1212 "psubusb " #lx ", " #sx " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1213 "movq "MANGLE(b00)", " #lx " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1214 "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
1215 "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
1216 "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
1217 "paddb " #t1 ", " #t0 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1218 "paddb " #t0 ", " #sx " \n\t"\
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1219 \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1220 PAVGB(plx, pplx) /* filtered */\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1221 "movq " #dst ", " #t0 " \n\t" /* dst */\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1222 "movq " #t0 ", " #t1 " \n\t" /* dst */\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1223 "psubusb %3, " #t0 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1224 "paddusb %3, " #t1 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1225 PMAXUB(t0, pplx)\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1226 PMINUB(t1, pplx, t0)\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1227 "paddb " #sx ", " #ppsx " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1228 "paddb " #psx ", " #ppsx " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1229 "#paddb "MANGLE(b02)", " #ppsx " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1230 "pand "MANGLE(b08)", " #ppsx " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1231 "pcmpeqb " #lx ", " #ppsx " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1232 "pand " #ppsx ", " #pplx " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1233 "pandn " #dst ", " #ppsx " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1234 "por " #pplx ", " #ppsx " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1235 "movq " #ppsx ", " #dst " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1236 "movq 8(%%"REG_c"), " #lx " \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1237
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1238 #define DERING_CORE(dst,src,ppsx,psx,sx,pplx,plx,lx,t0,t1) \
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1239 REAL_DERING_CORE(dst,src,ppsx,psx,sx,pplx,plx,lx,t0,t1)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1240 /*
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1241 0000000
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1242 1111111
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1243
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1244 1111110
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1245 1111101
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1246 1111100
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1247 1111011
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1248 1111010
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1249 1111001
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1250
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1251 1111000
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1252 1110111
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1253
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1254 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1255 //DERING_CORE(dst ,src ,ppsx ,psx ,sx ,pplx ,plx ,lx ,t0 ,t1)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1256 DERING_CORE((%%REGa) ,(%%REGa, %1) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1257 DERING_CORE((%%REGa, %1) ,(%%REGa, %1, 2),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1258 DERING_CORE((%%REGa, %1, 2),(%0, %1, 4) ,%%mm4,%%mm0,%%mm2,%%mm5,%%mm1,%%mm3,%%mm6,%%mm7)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1259 DERING_CORE((%0, %1, 4) ,(%%REGd) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1260 DERING_CORE((%%REGd) ,(%%REGd, %1) ,%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1261 DERING_CORE((%%REGd, %1) ,(%%REGd, %1, 2),%%mm4,%%mm0,%%mm2,%%mm5,%%mm1,%%mm3,%%mm6,%%mm7)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1262 DERING_CORE((%%REGd, %1, 2),(%0, %1, 8) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1263 DERING_CORE((%0, %1, 8) ,(%%REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1264
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1265 "1: \n\t"
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
1266 : : "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
1267 : "%"REG_a, "%"REG_d, "%"REG_c
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1268 );
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1269 #else //HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1270 int y;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1271 int min=255;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1272 int max=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1273 int avg;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1274 uint8_t *p;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1275 int s[10];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1276 const int QP2= c->QP/2 + 1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1277
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1278 for(y=1; y<9; y++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1279 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1280 p= src + stride*y;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1281 for(x=1; x<9; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1282 p++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1283 if(*p > max) max= *p;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1284 if(*p < min) min= *p;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1285 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1286 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1287 avg= (min + max + 1)>>1;
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 if(max - min <deringThreshold) return;
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 for(y=0; y<10; y++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1292 int t = 0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1293
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1294 if(src[stride*y + 0] > avg) t+= 1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1295 if(src[stride*y + 1] > avg) t+= 2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1296 if(src[stride*y + 2] > avg) t+= 4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1297 if(src[stride*y + 3] > avg) t+= 8;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1298 if(src[stride*y + 4] > avg) t+= 16;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1299 if(src[stride*y + 5] > avg) t+= 32;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1300 if(src[stride*y + 6] > avg) t+= 64;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1301 if(src[stride*y + 7] > avg) t+= 128;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1302 if(src[stride*y + 8] > avg) t+= 256;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1303 if(src[stride*y + 9] > avg) t+= 512;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1304
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1305 t |= (~t)<<16;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1306 t &= (t<<1) & (t>>1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1307 s[y] = t;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1308 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1309
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1310 for(y=1; y<9; y++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1311 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
1312 t|= t>>16;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1313 s[y-1]= t;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1314 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1315
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1316 for(y=1; y<9; y++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1317 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1318 int t = s[y-1];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1319
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1320 p= src + stride*y;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1321 for(x=1; x<9; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1322 p++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1323 if(t & (1<<x)){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1324 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
1325 +2*(*(p -1)) + 4*(*p ) + 2*(*(p +1))
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1326 +(*(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 f= (f + 8)>>4;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1328
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1329 #ifdef DEBUG_DERING_THRESHOLD
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
1330 __asm__ volatile("emms\n\t":);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1331 {
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1332 static long long numPixels=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1333 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
1334 // if((max-min)<20 || (max-min)*QP<200)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1335 // if((max-min)*QP < 500)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1336 // if(max-min<QP/2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1337 if(max-min < 20){
96
404a656698ff cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents: 95
diff changeset
1338 static int numSkipped=0;
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1339 static int errorSum=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1340 static int worstQP=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1341 static int worstRange=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1342 static int worstDiff=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1343 int diff= (f - *p);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1344 int absDiff= FFABS(diff);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1345 int error= diff*diff;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1346
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1347 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
1348
96
404a656698ff cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents: 95
diff changeset
1349 numSkipped++;
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1350 if(absDiff > worstDiff){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1351 worstDiff= absDiff;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1352 worstQP= QP;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1353 worstRange= max-min;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1354 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1355 errorSum+= error;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1356
96
404a656698ff cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents: 95
diff changeset
1357 if(1024LL*1024LL*1024LL % numSkipped == 0){
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1358 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
1359 "wRange:%d, wDiff:%d, relSkip:%1.3f\n",
96
404a656698ff cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents: 95
diff changeset
1360 (float)errorSum/numSkipped, numSkipped, worstQP, worstRange,
404a656698ff cosmetics: Fix typo in variable name, numSkiped --> numSkipped.
diego
parents: 95
diff changeset
1361 worstDiff, (float)numSkipped/numPixels);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1362 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1363 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1364 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1365 #endif
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1366 if (*p + QP2 < f) *p= *p + QP2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1367 else if(*p - QP2 > f) *p= *p - QP2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1368 else *p=f;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1369 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1370 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1371 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1372 #ifdef DEBUG_DERING_THRESHOLD
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1373 if(max-min < 20){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1374 for(y=1; y<9; y++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1375 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1376 int t = 0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1377 p= src + stride*y;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1378 for(x=1; x<9; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1379 p++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1380 *p = FFMIN(*p + 20, 255);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1381 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1382 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1383 // 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
1384 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1385 #endif
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1386 #endif //HAVE_MMX2 || HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1387 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1388 #endif //HAVE_ALTIVEC
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1389
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1390 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1391 * Deinterlaces the given block by linearly interpolating every second line.
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1392 * will be called for every 8x8 block and can read & write from line 4-15
90
8e738e0a16f5 typo fixes
diego
parents: 78
diff changeset
1393 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too.
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1394 * lines 4-12 will be read into the deblocking filter and should be deinterlaced
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1395 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1396 static inline void RENAME(deInterlaceInterpolateLinear)(uint8_t src[], int stride)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1397 {
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1398 #if HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1399 src+= 4*stride;
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
1400 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1401 "lea (%0, %1), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1402 "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1403 // 0 1 2 3 4 5 6 7 8 9
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1404 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %0+8%1 ecx+4%1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1405
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1406 "movq (%0), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1407 "movq (%%"REG_a", %1), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1408 PAVGB(%%mm1, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1409 "movq %%mm0, (%%"REG_a") \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1410 "movq (%0, %1, 4), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1411 PAVGB(%%mm0, %%mm1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1412 "movq %%mm1, (%%"REG_a", %1, 2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1413 "movq (%%"REG_c", %1), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1414 PAVGB(%%mm1, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1415 "movq %%mm0, (%%"REG_c") \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1416 "movq (%0, %1, 8), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1417 PAVGB(%%mm0, %%mm1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1418 "movq %%mm1, (%%"REG_c", %1, 2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1419
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
1420 : : "r" (src), "r" ((x86_reg)stride)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1421 : "%"REG_a, "%"REG_c
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1422 );
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1423 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1424 int a, b, x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1425 src+= 4*stride;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1426
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1427 for(x=0; x<2; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1428 a= *(uint32_t*)&src[stride*0];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1429 b= *(uint32_t*)&src[stride*2];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1430 *(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
1431 a= *(uint32_t*)&src[stride*4];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1432 *(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
1433 b= *(uint32_t*)&src[stride*6];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1434 *(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
1435 a= *(uint32_t*)&src[stride*8];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1436 *(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
1437 src += 4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1438 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1439 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1440 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1441
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1442 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1443 * Deinterlaces the given block by cubic interpolating every second line.
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1444 * will be called for every 8x8 block and can read & write from line 4-15
90
8e738e0a16f5 typo fixes
diego
parents: 78
diff changeset
1445 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too.
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1446 * lines 4-12 will be read into the deblocking filter and should be deinterlaced
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1447 * this filter will read lines 3-15 and write 7-13
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1448 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1449 static inline void RENAME(deInterlaceInterpolateCubic)(uint8_t src[], int stride)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1450 {
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1451 #if HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1452 src+= stride*3;
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
1453 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1454 "lea (%0, %1), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1455 "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
1456 "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
1457 "add %1, %%"REG_c" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1458 "pxor %%mm7, %%mm7 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1459 // 0 1 2 3 4 5 6 7 8 9 10
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1460 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1461
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1462 #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
1463 "movq " #a ", %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1464 "movq " #b ", %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1465 "movq " #d ", %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1466 "movq " #e ", %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1467 PAVGB(%%mm2, %%mm1) /* (b+d) /2 */\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1468 PAVGB(%%mm3, %%mm0) /* a(a+e) /2 */\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1469 "movq %%mm0, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1470 "punpcklbw %%mm7, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1471 "punpckhbw %%mm7, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1472 "movq %%mm1, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1473 "punpcklbw %%mm7, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1474 "punpckhbw %%mm7, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1475 "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
1476 "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
1477 "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
1478 "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
1479 "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
1480 "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
1481 "packuswb %%mm3, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1482 "movq %%mm1, " #c " \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1483 #define DEINT_CUBIC(a,b,c,d,e) REAL_DEINT_CUBIC(a,b,c,d,e)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1484
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1485 DEINT_CUBIC((%0) , (%%REGa, %1), (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd, %1))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1486 DEINT_CUBIC((%%REGa, %1), (%0, %1, 4) , (%%REGd) , (%%REGd, %1), (%0, %1, 8))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1487 DEINT_CUBIC((%0, %1, 4) , (%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8) , (%%REGc))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1488 DEINT_CUBIC((%%REGd, %1), (%0, %1, 8) , (%%REGd, %1, 4), (%%REGc) , (%%REGc, %1, 2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1489
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
1490 : : "r" (src), "r" ((x86_reg)stride)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1491 : "%"REG_a, "%"REG_d, "%"REG_c
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1492 );
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1493 #else //HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1494 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1495 src+= stride*3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1496 for(x=0; x<8; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1497 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
1498 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
1499 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
1500 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
1501 src++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1502 }
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1503 #endif //HAVE_MMX2 || HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1504 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1505
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1506 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1507 * Deinterlaces the given block by filtering every second line with a (-1 4 2 4 -1) filter.
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1508 * will be called for every 8x8 block and can read & write from line 4-15
90
8e738e0a16f5 typo fixes
diego
parents: 78
diff changeset
1509 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too.
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1510 * lines 4-12 will be read into the deblocking filter and should be deinterlaced
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1511 * this filter will read lines 4-13 and write 5-11
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1512 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1513 static inline void RENAME(deInterlaceFF)(uint8_t src[], int stride, uint8_t *tmp)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1514 {
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1515 #if HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1516 src+= stride*4;
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
1517 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1518 "lea (%0, %1), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1519 "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
1520 "pxor %%mm7, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1521 "movq (%2), %%mm0 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1522 // 0 1 2 3 4 5 6 7 8 9 10
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1523 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1524
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1525 #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
1526 "movq " #a ", %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1527 "movq " #b ", %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1528 "movq " #c ", %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1529 "movq " #d ", %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1530 PAVGB(%%mm3, %%mm1) \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1531 PAVGB(%%mm4, %%mm0) \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1532 "movq %%mm0, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1533 "punpcklbw %%mm7, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1534 "punpckhbw %%mm7, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1535 "movq %%mm1, %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1536 "punpcklbw %%mm7, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1537 "punpckhbw %%mm7, %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1538 "psllw $2, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1539 "psllw $2, %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1540 "psubw %%mm0, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1541 "psubw %%mm3, %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1542 "movq %%mm2, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1543 "movq %%mm2, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1544 "punpcklbw %%mm7, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1545 "punpckhbw %%mm7, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1546 "paddw %%mm2, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1547 "paddw %%mm5, %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1548 "psraw $2, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1549 "psraw $2, %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1550 "packuswb %%mm4, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1551 "movq %%mm1, " #b " \n\t"\
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1552
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1553 #define DEINT_FF(a,b,c,d) REAL_DEINT_FF(a,b,c,d)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1554
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1555 DEINT_FF((%0) , (%%REGa) , (%%REGa, %1), (%%REGa, %1, 2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1556 DEINT_FF((%%REGa, %1), (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd) )
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1557 DEINT_FF((%0, %1, 4) , (%%REGd) , (%%REGd, %1), (%%REGd, %1, 2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1558 DEINT_FF((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1559
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1560 "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
1561 : : "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
1562 : "%"REG_a, "%"REG_d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1563 );
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1564 #else //HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1565 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1566 src+= stride*4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1567 for(x=0; x<8; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1568 int t1= tmp[x];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1569 int t2= src[stride*1];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1570
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1571 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
1572 t1= src[stride*4];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1573 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
1574 t2= src[stride*6];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1575 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
1576 t1= src[stride*8];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1577 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
1578 tmp[x]= t1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1579
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1580 src++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1581 }
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1582 #endif //HAVE_MMX2 || HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1583 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1584
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1585 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1586 * Deinterlaces the given block by filtering every line with a (-1 2 6 2 -1) filter.
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1587 * will be called for every 8x8 block and can read & write from line 4-15
90
8e738e0a16f5 typo fixes
diego
parents: 78
diff changeset
1588 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too.
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1589 * lines 4-12 will be read into the deblocking filter and should be deinterlaced
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1590 * this filter will read lines 4-13 and write 4-11
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1591 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1592 static inline void RENAME(deInterlaceL5)(uint8_t src[], int stride, uint8_t *tmp, uint8_t *tmp2)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1593 {
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1594 #if HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1595 src+= stride*4;
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
1596 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1597 "lea (%0, %1), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1598 "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
1599 "pxor %%mm7, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1600 "movq (%2), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1601 "movq (%3), %%mm1 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1602 // 0 1 2 3 4 5 6 7 8 9 10
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1603 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1604
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1605 #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
1606 "movq " #a ", %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1607 "movq " #b ", %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1608 "movq " #c ", %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1609 PAVGB(t2, %%mm3) \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1610 PAVGB(t1, %%mm4) \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1611 "movq %%mm2, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1612 "movq %%mm2, " #t1 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1613 "punpcklbw %%mm7, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1614 "punpckhbw %%mm7, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1615 "movq %%mm2, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1616 "paddw %%mm2, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1617 "paddw %%mm6, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1618 "movq %%mm5, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1619 "paddw %%mm5, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1620 "paddw %%mm6, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1621 "movq %%mm3, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1622 "punpcklbw %%mm7, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1623 "punpckhbw %%mm7, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1624 "paddw %%mm3, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1625 "paddw %%mm6, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1626 "paddw %%mm3, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1627 "paddw %%mm6, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1628 "movq %%mm4, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1629 "punpcklbw %%mm7, %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1630 "punpckhbw %%mm7, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1631 "psubw %%mm4, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1632 "psubw %%mm6, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1633 "psraw $2, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1634 "psraw $2, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1635 "packuswb %%mm5, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1636 "movq %%mm2, " #a " \n\t"\
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1637
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1638 #define DEINT_L5(t1,t2,a,b,c) REAL_DEINT_L5(t1,t2,a,b,c)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1639
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1640 DEINT_L5(%%mm0, %%mm1, (%0) , (%%REGa) , (%%REGa, %1) )
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1641 DEINT_L5(%%mm1, %%mm0, (%%REGa) , (%%REGa, %1) , (%%REGa, %1, 2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1642 DEINT_L5(%%mm0, %%mm1, (%%REGa, %1) , (%%REGa, %1, 2), (%0, %1, 4) )
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1643 DEINT_L5(%%mm1, %%mm0, (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd) )
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1644 DEINT_L5(%%mm0, %%mm1, (%0, %1, 4) , (%%REGd) , (%%REGd, %1) )
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1645 DEINT_L5(%%mm1, %%mm0, (%%REGd) , (%%REGd, %1) , (%%REGd, %1, 2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1646 DEINT_L5(%%mm0, %%mm1, (%%REGd, %1) , (%%REGd, %1, 2), (%0, %1, 8) )
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1647 DEINT_L5(%%mm1, %%mm0, (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1648
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1649 "movq %%mm0, (%2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1650 "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
1651 : : "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
1652 : "%"REG_a, "%"REG_d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1653 );
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1654 #else //HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1655 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1656 src+= stride*4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1657 for(x=0; x<8; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1658 int t1= tmp[x];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1659 int t2= tmp2[x];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1660 int t3= src[0];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1661
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1662 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
1663 t1= src[stride*1];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1664 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
1665 t2= src[stride*2];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1666 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
1667 t3= src[stride*3];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1668 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
1669 t1= src[stride*4];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1670 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
1671 t2= src[stride*5];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1672 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
1673 t3= src[stride*6];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1674 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
1675 t1= src[stride*7];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1676 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
1677
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1678 tmp[x]= t3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1679 tmp2[x]= t1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1680
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1681 src++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1682 }
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1683 #endif //HAVE_MMX2 || HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1684 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1685
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1686 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1687 * Deinterlaces the given block by filtering all lines with a (1 2 1) filter.
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1688 * will be called for every 8x8 block and can read & write from line 4-15
90
8e738e0a16f5 typo fixes
diego
parents: 78
diff changeset
1689 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too.
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1690 * lines 4-12 will be read into the deblocking filter and should be deinterlaced
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1691 * this filter will read lines 4-13 and write 4-11
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1692 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1693 static inline void RENAME(deInterlaceBlendLinear)(uint8_t src[], int stride, uint8_t *tmp)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1694 {
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1695 #if HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1696 src+= 4*stride;
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
1697 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1698 "lea (%0, %1), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1699 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1700 // 0 1 2 3 4 5 6 7 8 9
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1701 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1702
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1703 "movq (%2), %%mm0 \n\t" // L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1704 "movq (%%"REG_a"), %%mm1 \n\t" // L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1705 PAVGB(%%mm1, %%mm0) // L0+L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1706 "movq (%0), %%mm2 \n\t" // L1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1707 PAVGB(%%mm2, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1708 "movq %%mm0, (%0) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1709 "movq (%%"REG_a", %1), %%mm0 \n\t" // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1710 PAVGB(%%mm0, %%mm2) // L1+L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1711 PAVGB(%%mm1, %%mm2) // 2L2 + L1 + L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1712 "movq %%mm2, (%%"REG_a") \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1713 "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
1714 PAVGB(%%mm2, %%mm1) // L2+L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1715 PAVGB(%%mm0, %%mm1) // 2L3 + L2 + L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1716 "movq %%mm1, (%%"REG_a", %1) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1717 "movq (%0, %1, 4), %%mm1 \n\t" // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1718 PAVGB(%%mm1, %%mm0) // L3+L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1719 PAVGB(%%mm2, %%mm0) // 2L4 + L3 + L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1720 "movq %%mm0, (%%"REG_a", %1, 2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1721 "movq (%%"REG_d"), %%mm0 \n\t" // L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1722 PAVGB(%%mm0, %%mm2) // L4+L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1723 PAVGB(%%mm1, %%mm2) // 2L5 + L4 + L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1724 "movq %%mm2, (%0, %1, 4) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1725 "movq (%%"REG_d", %1), %%mm2 \n\t" // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1726 PAVGB(%%mm2, %%mm1) // L5+L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1727 PAVGB(%%mm0, %%mm1) // 2L6 + L5 + L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1728 "movq %%mm1, (%%"REG_d") \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1729 "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
1730 PAVGB(%%mm1, %%mm0) // L6+L8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1731 PAVGB(%%mm2, %%mm0) // 2L7 + L6 + L8
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1732 "movq %%mm0, (%%"REG_d", %1) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1733 "movq (%0, %1, 8), %%mm0 \n\t" // L9
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1734 PAVGB(%%mm0, %%mm2) // L7+L9
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1735 PAVGB(%%mm1, %%mm2) // 2L8 + L7 + L9
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1736 "movq %%mm2, (%%"REG_d", %1, 2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1737 "movq %%mm1, (%2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1738
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
1739 : : "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
1740 : "%"REG_a, "%"REG_d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1741 );
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1742 #else //HAVE_MMX2 || HAVE_AMD3DNOW
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1743 int a, b, c, x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1744 src+= 4*stride;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1745
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1746 for(x=0; x<2; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1747 a= *(uint32_t*)&tmp[stride*0];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1748 b= *(uint32_t*)&src[stride*0];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1749 c= *(uint32_t*)&src[stride*1];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1750 a= (a&c) + (((a^c)&0xFEFEFEFEUL)>>1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1751 *(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
1752
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1753 a= *(uint32_t*)&src[stride*2];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1754 b= (a&b) + (((a^b)&0xFEFEFEFEUL)>>1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1755 *(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
1756
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1757 b= *(uint32_t*)&src[stride*3];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1758 c= (b&c) + (((b^c)&0xFEFEFEFEUL)>>1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1759 *(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
1760
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1761 c= *(uint32_t*)&src[stride*4];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1762 a= (a&c) + (((a^c)&0xFEFEFEFEUL)>>1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1763 *(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
1764
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1765 a= *(uint32_t*)&src[stride*5];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1766 b= (a&b) + (((a^b)&0xFEFEFEFEUL)>>1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1767 *(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
1768
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1769 b= *(uint32_t*)&src[stride*6];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1770 c= (b&c) + (((b^c)&0xFEFEFEFEUL)>>1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1771 *(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
1772
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1773 c= *(uint32_t*)&src[stride*7];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1774 a= (a&c) + (((a^c)&0xFEFEFEFEUL)>>1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1775 *(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
1776
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1777 a= *(uint32_t*)&src[stride*8];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1778 b= (a&b) + (((a^b)&0xFEFEFEFEUL)>>1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1779 *(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
1780
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1781 *(uint32_t*)&tmp[stride*0]= c;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1782 src += 4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1783 tmp += 4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1784 }
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
1785 #endif //HAVE_MMX2 || HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1786 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1787
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1788 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1789 * Deinterlaces the given block by applying a median filter to every second line.
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1790 * will be called for every 8x8 block and can read & write from line 4-15,
90
8e738e0a16f5 typo fixes
diego
parents: 78
diff changeset
1791 * lines 0-3 have been passed through the deblock / dering filters already, but can be read, too.
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1792 * lines 4-12 will be read into the deblocking filter and should be deinterlaced
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1793 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1794 static inline void RENAME(deInterlaceMedian)(uint8_t src[], int stride)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1795 {
119
4a1602d552aa Fix compilation.
cehoyos
parents: 118
diff changeset
1796 #if HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1797 src+= 4*stride;
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
1798 #if HAVE_MMX2
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
1799 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1800 "lea (%0, %1), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1801 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1802 // 0 1 2 3 4 5 6 7 8 9
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1803 // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1804
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1805 "movq (%0), %%mm0 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1806 "movq (%%"REG_a", %1), %%mm2 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1807 "movq (%%"REG_a"), %%mm1 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1808 "movq %%mm0, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1809 "pmaxub %%mm1, %%mm0 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1810 "pminub %%mm3, %%mm1 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1811 "pmaxub %%mm2, %%mm1 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1812 "pminub %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1813 "movq %%mm0, (%%"REG_a") \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1814
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1815 "movq (%0, %1, 4), %%mm0 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1816 "movq (%%"REG_a", %1, 2), %%mm1 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1817 "movq %%mm2, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1818 "pmaxub %%mm1, %%mm2 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1819 "pminub %%mm3, %%mm1 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1820 "pmaxub %%mm0, %%mm1 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1821 "pminub %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1822 "movq %%mm2, (%%"REG_a", %1, 2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1823
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1824 "movq (%%"REG_d"), %%mm2 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1825 "movq (%%"REG_d", %1), %%mm1 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1826 "movq %%mm2, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1827 "pmaxub %%mm0, %%mm2 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1828 "pminub %%mm3, %%mm0 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1829 "pmaxub %%mm1, %%mm0 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1830 "pminub %%mm0, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1831 "movq %%mm2, (%%"REG_d") \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1832
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1833 "movq (%%"REG_d", %1, 2), %%mm2 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1834 "movq (%0, %1, 8), %%mm0 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1835 "movq %%mm2, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1836 "pmaxub %%mm0, %%mm2 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1837 "pminub %%mm3, %%mm0 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1838 "pmaxub %%mm1, %%mm0 \n\t" //
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1839 "pminub %%mm0, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1840 "movq %%mm2, (%%"REG_d", %1, 2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1841
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1842
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
1843 : : "r" (src), "r" ((x86_reg)stride)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1844 : "%"REG_a, "%"REG_d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1845 );
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1846
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1847 #else // MMX without MMX2
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
1848 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1849 "lea (%0, %1), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1850 "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1851 // 0 1 2 3 4 5 6 7 8 9
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1852 // %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
1853 "pxor %%mm7, %%mm7 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1854
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1855 #define REAL_MEDIAN(a,b,c)\
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1856 "movq " #a ", %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1857 "movq " #b ", %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1858 "movq " #c ", %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1859 "movq %%mm0, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1860 "movq %%mm1, %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1861 "movq %%mm2, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1862 "psubusb %%mm1, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1863 "psubusb %%mm2, %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1864 "psubusb %%mm0, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1865 "pcmpeqb %%mm7, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1866 "pcmpeqb %%mm7, %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1867 "pcmpeqb %%mm7, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1868 "movq %%mm3, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1869 "pxor %%mm4, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1870 "pxor %%mm5, %%mm4 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1871 "pxor %%mm6, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1872 "por %%mm3, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1873 "por %%mm4, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1874 "por %%mm5, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1875 "pand %%mm2, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1876 "pand %%mm1, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1877 "movq %%mm0, " #b " \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1878 #define MEDIAN(a,b,c) REAL_MEDIAN(a,b,c)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1879
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1880 MEDIAN((%0) , (%%REGa) , (%%REGa, %1))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1881 MEDIAN((%%REGa, %1), (%%REGa, %1, 2), (%0, %1, 4))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1882 MEDIAN((%0, %1, 4) , (%%REGd) , (%%REGd, %1))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1883 MEDIAN((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1884
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
1885 : : "r" (src), "r" ((x86_reg)stride)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1886 : "%"REG_a, "%"REG_d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1887 );
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1888 #endif //HAVE_MMX2
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1889 #else //HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1890 int x, y;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1891 src+= 4*stride;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1892 // 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
1893 for(x=0; x<8; x++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1894 uint8_t *colsrc = src;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1895 for (y=0; y<4; y++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1896 int a, b, c, d, e, f;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1897 a = colsrc[0 ];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1898 b = colsrc[stride ];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1899 c = colsrc[stride*2];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1900 d = (a-b)>>31;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1901 e = (b-c)>>31;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1902 f = (c-a)>>31;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1903 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
1904 colsrc += stride*2;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1905 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1906 src++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1907 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1908 #endif //HAVE_MMX
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1909 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1910
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
1911 #if HAVE_MMX
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1912 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1913 * transposes and shift the given 8x8 Block into dst1 and dst2
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1914 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1915 static inline void RENAME(transpose1)(uint8_t *dst1, uint8_t *dst2, uint8_t *src, int srcStride)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1916 {
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
1917 __asm__(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1918 "lea (%0, %1), %%"REG_a" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1919 // 0 1 2 3 4 5 6 7 8 9
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1920 // %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
1921 "movq (%0), %%mm0 \n\t" // 12345678
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1922 "movq (%%"REG_a"), %%mm1 \n\t" // abcdefgh
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1923 "movq %%mm0, %%mm2 \n\t" // 12345678
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1924 "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1925 "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1926
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1927 "movq (%%"REG_a", %1), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1928 "movq (%%"REG_a", %1, 2), %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1929 "movq %%mm1, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1930 "punpcklbw %%mm3, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1931 "punpckhbw %%mm3, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1932
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1933 "movq %%mm0, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1934 "punpcklwd %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1935 "punpckhwd %%mm1, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1936 "movq %%mm2, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1937 "punpcklwd %%mm4, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1938 "punpckhwd %%mm4, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1939
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1940 "movd %%mm0, 128(%2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1941 "psrlq $32, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1942 "movd %%mm0, 144(%2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1943 "movd %%mm3, 160(%2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1944 "psrlq $32, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1945 "movd %%mm3, 176(%2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1946 "movd %%mm3, 48(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1947 "movd %%mm2, 192(%2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1948 "movd %%mm2, 64(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1949 "psrlq $32, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1950 "movd %%mm2, 80(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1951 "movd %%mm1, 96(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1952 "psrlq $32, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1953 "movd %%mm1, 112(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1954
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1955 "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
1956
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1957 "movq (%0, %1, 4), %%mm0 \n\t" // 12345678
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1958 "movq (%%"REG_a"), %%mm1 \n\t" // abcdefgh
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1959 "movq %%mm0, %%mm2 \n\t" // 12345678
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1960 "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1961 "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1962
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1963 "movq (%%"REG_a", %1), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1964 "movq (%%"REG_a", %1, 2), %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1965 "movq %%mm1, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1966 "punpcklbw %%mm3, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1967 "punpckhbw %%mm3, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1968
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1969 "movq %%mm0, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1970 "punpcklwd %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1971 "punpckhwd %%mm1, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1972 "movq %%mm2, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1973 "punpcklwd %%mm4, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1974 "punpckhwd %%mm4, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1975
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1976 "movd %%mm0, 132(%2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1977 "psrlq $32, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1978 "movd %%mm0, 148(%2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1979 "movd %%mm3, 164(%2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1980 "psrlq $32, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1981 "movd %%mm3, 180(%2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1982 "movd %%mm3, 52(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1983 "movd %%mm2, 196(%2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1984 "movd %%mm2, 68(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1985 "psrlq $32, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1986 "movd %%mm2, 84(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1987 "movd %%mm1, 100(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1988 "psrlq $32, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1989 "movd %%mm1, 116(%3) \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1990
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1991
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
1992 :: "r" (src), "r" ((x86_reg)srcStride), "r" (dst1), "r" (dst2)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1993 : "%"REG_a
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
1994 );
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1995 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1996
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1997 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1998 * transposes the given 8x8 block
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1999 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2000 static inline void RENAME(transpose2)(uint8_t *dst, int dstStride, uint8_t *src)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2001 {
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
2002 __asm__(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2003 "lea (%0, %1), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2004 "lea (%%"REG_a",%1,4), %%"REG_d" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2005 // 0 1 2 3 4 5 6 7 8 9
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2006 // %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
2007 "movq (%2), %%mm0 \n\t" // 12345678
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2008 "movq 16(%2), %%mm1 \n\t" // abcdefgh
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2009 "movq %%mm0, %%mm2 \n\t" // 12345678
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2010 "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2011 "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2012
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2013 "movq 32(%2), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2014 "movq 48(%2), %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2015 "movq %%mm1, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2016 "punpcklbw %%mm3, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2017 "punpckhbw %%mm3, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2018
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2019 "movq %%mm0, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2020 "punpcklwd %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2021 "punpckhwd %%mm1, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2022 "movq %%mm2, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2023 "punpcklwd %%mm4, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2024 "punpckhwd %%mm4, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2025
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2026 "movd %%mm0, (%0) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2027 "psrlq $32, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2028 "movd %%mm0, (%%"REG_a") \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2029 "movd %%mm3, (%%"REG_a", %1) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2030 "psrlq $32, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2031 "movd %%mm3, (%%"REG_a", %1, 2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2032 "movd %%mm2, (%0, %1, 4) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2033 "psrlq $32, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2034 "movd %%mm2, (%%"REG_d") \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2035 "movd %%mm1, (%%"REG_d", %1) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2036 "psrlq $32, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2037 "movd %%mm1, (%%"REG_d", %1, 2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2038
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2039
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2040 "movq 64(%2), %%mm0 \n\t" // 12345678
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2041 "movq 80(%2), %%mm1 \n\t" // abcdefgh
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2042 "movq %%mm0, %%mm2 \n\t" // 12345678
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2043 "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2044 "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2045
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2046 "movq 96(%2), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2047 "movq 112(%2), %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2048 "movq %%mm1, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2049 "punpcklbw %%mm3, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2050 "punpckhbw %%mm3, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2051
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2052 "movq %%mm0, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2053 "punpcklwd %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2054 "punpckhwd %%mm1, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2055 "movq %%mm2, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2056 "punpcklwd %%mm4, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2057 "punpckhwd %%mm4, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2058
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2059 "movd %%mm0, 4(%0) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2060 "psrlq $32, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2061 "movd %%mm0, 4(%%"REG_a") \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2062 "movd %%mm3, 4(%%"REG_a", %1) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2063 "psrlq $32, %%mm3 \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, 2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2065 "movd %%mm2, 4(%0, %1, 4) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2066 "psrlq $32, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2067 "movd %%mm2, 4(%%"REG_d") \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2068 "movd %%mm1, 4(%%"REG_d", %1) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2069 "psrlq $32, %%mm1 \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, 2) \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2071
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
2072 :: "r" (dst), "r" ((x86_reg)dstStride), "r" (src)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2073 : "%"REG_a, "%"REG_d
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2074 );
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2075 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2076 #endif //HAVE_MMX
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2077 //static long test=0;
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2078
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
2079 #if !HAVE_ALTIVEC
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2080 static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride,
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2081 uint8_t *tempBlurred, uint32_t *tempBlurredPast, int *maxNoise)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2082 {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2083 // to save a register (FIXME do this outside of the loops)
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2084 tempBlurredPast[127]= maxNoise[0];
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2085 tempBlurredPast[128]= maxNoise[1];
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2086 tempBlurredPast[129]= maxNoise[2];
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2087
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2088 #define FAST_L2_DIFF
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2089 //#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
2090 #if HAVE_MMX2 || HAVE_AMD3DNOW
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
2091 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2092 "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
2093 "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
2094 "lea (%%"REG_d", %2, 2), %%"REG_c" \n\t" // 7*stride
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2095 // 0 1 2 3 4 5 6 7 8 9
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2096 // %x %x+%2 %x+2%2 %x+eax %x+4%2 %x+edx %x+2eax %x+ecx %x+8%2
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2097 //FIXME reorder?
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2098 #ifdef L1_DIFF //needs mmx2
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2099 "movq (%0), %%mm0 \n\t" // L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2100 "psadbw (%1), %%mm0 \n\t" // |L0-R0|
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2101 "movq (%0, %2), %%mm1 \n\t" // L1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2102 "psadbw (%1, %2), %%mm1 \n\t" // |L1-R1|
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2103 "movq (%0, %2, 2), %%mm2 \n\t" // L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2104 "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
2105 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2106 "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
2107
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2108 "movq (%0, %2, 4), %%mm4 \n\t" // L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2109 "paddw %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2110 "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
2111 "movq (%0, %%"REG_d"), %%mm5 \n\t" // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2112 "paddw %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2113 "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
2114 "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
2115 "paddw %%mm3, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2116 "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
2117 "movq (%0, %%"REG_c"), %%mm7 \n\t" // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2118 "paddw %%mm4, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2119 "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
2120 "paddw %%mm5, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2121 "paddw %%mm7, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2122 "paddw %%mm6, %%mm0 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2123 #else //L1_DIFF
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2124 #if defined (FAST_L2_DIFF)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2125 "pcmpeqb %%mm7, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2126 "movq "MANGLE(b80)", %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2127 "pxor %%mm0, %%mm0 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2128 #define REAL_L2_DIFF_CORE(a, b)\
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2129 "movq " #a ", %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2130 "movq " #b ", %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2131 "pxor %%mm7, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2132 PAVGB(%%mm2, %%mm5)\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2133 "paddb %%mm6, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2134 "movq %%mm5, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2135 "psllw $8, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2136 "pmaddwd %%mm5, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2137 "pmaddwd %%mm2, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2138 "paddd %%mm2, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2139 "psrld $14, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2140 "paddd %%mm5, %%mm0 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2141
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2142 #else //defined (FAST_L2_DIFF)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2143 "pxor %%mm7, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2144 "pxor %%mm0, %%mm0 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2145 #define REAL_L2_DIFF_CORE(a, b)\
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2146 "movq " #a ", %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2147 "movq " #b ", %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2148 "movq %%mm5, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2149 "movq %%mm2, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2150 "punpcklbw %%mm7, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2151 "punpckhbw %%mm7, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2152 "punpcklbw %%mm7, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2153 "punpckhbw %%mm7, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2154 "psubw %%mm2, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2155 "psubw %%mm3, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2156 "pmaddwd %%mm5, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2157 "pmaddwd %%mm1, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2158 "paddd %%mm1, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2159 "paddd %%mm5, %%mm0 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2160
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2161 #endif //defined (FAST_L2_DIFF)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2162
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2163 #define L2_DIFF_CORE(a, b) REAL_L2_DIFF_CORE(a, b)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2164
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2165 L2_DIFF_CORE((%0) , (%1))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2166 L2_DIFF_CORE((%0, %2) , (%1, %2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2167 L2_DIFF_CORE((%0, %2, 2) , (%1, %2, 2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2168 L2_DIFF_CORE((%0, %%REGa) , (%1, %%REGa))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2169 L2_DIFF_CORE((%0, %2, 4) , (%1, %2, 4))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2170 L2_DIFF_CORE((%0, %%REGd) , (%1, %%REGd))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2171 L2_DIFF_CORE((%0, %%REGa,2), (%1, %%REGa,2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2172 L2_DIFF_CORE((%0, %%REGc) , (%1, %%REGc))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2173
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2174 #endif //L1_DIFF
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2175
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2176 "movq %%mm0, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2177 "psrlq $32, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2178 "paddd %%mm0, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2179 "movd %%mm4, %%ecx \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2180 "shll $2, %%ecx \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2181 "mov %3, %%"REG_d" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2182 "addl -4(%%"REG_d"), %%ecx \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2183 "addl 4(%%"REG_d"), %%ecx \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2184 "addl -1024(%%"REG_d"), %%ecx \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2185 "addl $4, %%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 "shrl $3, %%ecx \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2188 "movl %%ecx, (%%"REG_d") \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2189
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2190 // "mov %3, %%"REG_c" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2191 // "mov %%"REG_c", test \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2192 // "jmp 4f \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2193 "cmpl 512(%%"REG_d"), %%ecx \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2194 " jb 2f \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2195 "cmpl 516(%%"REG_d"), %%ecx \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2196 " jb 1f \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2197
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2198 "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
2199 "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
2200 "movq (%0), %%mm0 \n\t" // L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2201 "movq (%0, %2), %%mm1 \n\t" // L1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2202 "movq (%0, %2, 2), %%mm2 \n\t" // L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2203 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2204 "movq (%0, %2, 4), %%mm4 \n\t" // L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2205 "movq (%0, %%"REG_d"), %%mm5 \n\t" // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2206 "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
2207 "movq (%0, %%"REG_c"), %%mm7 \n\t" // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2208 "movq %%mm0, (%1) \n\t" // L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2209 "movq %%mm1, (%1, %2) \n\t" // L1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2210 "movq %%mm2, (%1, %2, 2) \n\t" // L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2211 "movq %%mm3, (%1, %%"REG_a") \n\t" // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2212 "movq %%mm4, (%1, %2, 4) \n\t" // L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2213 "movq %%mm5, (%1, %%"REG_d") \n\t" // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2214 "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
2215 "movq %%mm7, (%1, %%"REG_c") \n\t" // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2216 "jmp 4f \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2217
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2218 "1: \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2219 "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
2220 "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
2221 "movq (%0), %%mm0 \n\t" // L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2222 PAVGB((%1), %%mm0) // L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2223 "movq (%0, %2), %%mm1 \n\t" // L1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2224 PAVGB((%1, %2), %%mm1) // L1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2225 "movq (%0, %2, 2), %%mm2 \n\t" // L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2226 PAVGB((%1, %2, 2), %%mm2) // L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2227 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2228 PAVGB((%1, %%REGa), %%mm3) // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2229 "movq (%0, %2, 4), %%mm4 \n\t" // L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2230 PAVGB((%1, %2, 4), %%mm4) // L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2231 "movq (%0, %%"REG_d"), %%mm5 \n\t" // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2232 PAVGB((%1, %%REGd), %%mm5) // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2233 "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
2234 PAVGB((%1, %%REGa, 2), %%mm6) // L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2235 "movq (%0, %%"REG_c"), %%mm7 \n\t" // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2236 PAVGB((%1, %%REGc), %%mm7) // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2237 "movq %%mm0, (%1) \n\t" // R0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2238 "movq %%mm1, (%1, %2) \n\t" // R1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2239 "movq %%mm2, (%1, %2, 2) \n\t" // R2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2240 "movq %%mm3, (%1, %%"REG_a") \n\t" // R3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2241 "movq %%mm4, (%1, %2, 4) \n\t" // R4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2242 "movq %%mm5, (%1, %%"REG_d") \n\t" // R5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2243 "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
2244 "movq %%mm7, (%1, %%"REG_c") \n\t" // R7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2245 "movq %%mm0, (%0) \n\t" // L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2246 "movq %%mm1, (%0, %2) \n\t" // L1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2247 "movq %%mm2, (%0, %2, 2) \n\t" // L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2248 "movq %%mm3, (%0, %%"REG_a") \n\t" // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2249 "movq %%mm4, (%0, %2, 4) \n\t" // L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2250 "movq %%mm5, (%0, %%"REG_d") \n\t" // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2251 "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
2252 "movq %%mm7, (%0, %%"REG_c") \n\t" // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2253 "jmp 4f \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2254
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2255 "2: \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2256 "cmpl 508(%%"REG_d"), %%ecx \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2257 " jb 3f \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2258
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2259 "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
2260 "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
2261 "movq (%0), %%mm0 \n\t" // L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2262 "movq (%0, %2), %%mm1 \n\t" // L1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2263 "movq (%0, %2, 2), %%mm2 \n\t" // L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2264 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2265 "movq (%1), %%mm4 \n\t" // R0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2266 "movq (%1, %2), %%mm5 \n\t" // R1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2267 "movq (%1, %2, 2), %%mm6 \n\t" // R2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2268 "movq (%1, %%"REG_a"), %%mm7 \n\t" // R3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2269 PAVGB(%%mm4, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2270 PAVGB(%%mm5, %%mm1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2271 PAVGB(%%mm6, %%mm2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2272 PAVGB(%%mm7, %%mm3)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2273 PAVGB(%%mm4, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2274 PAVGB(%%mm5, %%mm1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2275 PAVGB(%%mm6, %%mm2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2276 PAVGB(%%mm7, %%mm3)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2277 "movq %%mm0, (%1) \n\t" // R0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2278 "movq %%mm1, (%1, %2) \n\t" // R1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2279 "movq %%mm2, (%1, %2, 2) \n\t" // R2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2280 "movq %%mm3, (%1, %%"REG_a") \n\t" // R3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2281 "movq %%mm0, (%0) \n\t" // L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2282 "movq %%mm1, (%0, %2) \n\t" // L1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2283 "movq %%mm2, (%0, %2, 2) \n\t" // L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2284 "movq %%mm3, (%0, %%"REG_a") \n\t" // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2285
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2286 "movq (%0, %2, 4), %%mm0 \n\t" // L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2287 "movq (%0, %%"REG_d"), %%mm1 \n\t" // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2288 "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
2289 "movq (%0, %%"REG_c"), %%mm3 \n\t" // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2290 "movq (%1, %2, 4), %%mm4 \n\t" // R4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2291 "movq (%1, %%"REG_d"), %%mm5 \n\t" // R5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2292 "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
2293 "movq (%1, %%"REG_c"), %%mm7 \n\t" // R7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2294 PAVGB(%%mm4, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2295 PAVGB(%%mm5, %%mm1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2296 PAVGB(%%mm6, %%mm2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2297 PAVGB(%%mm7, %%mm3)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2298 PAVGB(%%mm4, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2299 PAVGB(%%mm5, %%mm1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2300 PAVGB(%%mm6, %%mm2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2301 PAVGB(%%mm7, %%mm3)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2302 "movq %%mm0, (%1, %2, 4) \n\t" // R4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2303 "movq %%mm1, (%1, %%"REG_d") \n\t" // R5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2304 "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
2305 "movq %%mm3, (%1, %%"REG_c") \n\t" // R7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2306 "movq %%mm0, (%0, %2, 4) \n\t" // L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2307 "movq %%mm1, (%0, %%"REG_d") \n\t" // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2308 "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
2309 "movq %%mm3, (%0, %%"REG_c") \n\t" // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2310 "jmp 4f \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2311
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2312 "3: \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2313 "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
2314 "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
2315 "movq (%0), %%mm0 \n\t" // L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2316 "movq (%0, %2), %%mm1 \n\t" // L1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2317 "movq (%0, %2, 2), %%mm2 \n\t" // L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2318 "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2319 "movq (%1), %%mm4 \n\t" // R0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2320 "movq (%1, %2), %%mm5 \n\t" // R1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2321 "movq (%1, %2, 2), %%mm6 \n\t" // R2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2322 "movq (%1, %%"REG_a"), %%mm7 \n\t" // R3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2323 PAVGB(%%mm4, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2324 PAVGB(%%mm5, %%mm1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2325 PAVGB(%%mm6, %%mm2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2326 PAVGB(%%mm7, %%mm3)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2327 PAVGB(%%mm4, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2328 PAVGB(%%mm5, %%mm1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2329 PAVGB(%%mm6, %%mm2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2330 PAVGB(%%mm7, %%mm3)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2331 PAVGB(%%mm4, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2332 PAVGB(%%mm5, %%mm1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2333 PAVGB(%%mm6, %%mm2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2334 PAVGB(%%mm7, %%mm3)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2335 "movq %%mm0, (%1) \n\t" // R0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2336 "movq %%mm1, (%1, %2) \n\t" // R1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2337 "movq %%mm2, (%1, %2, 2) \n\t" // R2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2338 "movq %%mm3, (%1, %%"REG_a") \n\t" // R3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2339 "movq %%mm0, (%0) \n\t" // L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2340 "movq %%mm1, (%0, %2) \n\t" // L1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2341 "movq %%mm2, (%0, %2, 2) \n\t" // L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2342 "movq %%mm3, (%0, %%"REG_a") \n\t" // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2343
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2344 "movq (%0, %2, 4), %%mm0 \n\t" // L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2345 "movq (%0, %%"REG_d"), %%mm1 \n\t" // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2346 "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
2347 "movq (%0, %%"REG_c"), %%mm3 \n\t" // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2348 "movq (%1, %2, 4), %%mm4 \n\t" // R4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2349 "movq (%1, %%"REG_d"), %%mm5 \n\t" // R5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2350 "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
2351 "movq (%1, %%"REG_c"), %%mm7 \n\t" // R7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2352 PAVGB(%%mm4, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2353 PAVGB(%%mm5, %%mm1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2354 PAVGB(%%mm6, %%mm2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2355 PAVGB(%%mm7, %%mm3)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2356 PAVGB(%%mm4, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2357 PAVGB(%%mm5, %%mm1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2358 PAVGB(%%mm6, %%mm2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2359 PAVGB(%%mm7, %%mm3)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2360 PAVGB(%%mm4, %%mm0)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2361 PAVGB(%%mm5, %%mm1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2362 PAVGB(%%mm6, %%mm2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2363 PAVGB(%%mm7, %%mm3)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2364 "movq %%mm0, (%1, %2, 4) \n\t" // R4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2365 "movq %%mm1, (%1, %%"REG_d") \n\t" // R5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2366 "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
2367 "movq %%mm3, (%1, %%"REG_c") \n\t" // R7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2368 "movq %%mm0, (%0, %2, 4) \n\t" // L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2369 "movq %%mm1, (%0, %%"REG_d") \n\t" // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2370 "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
2371 "movq %%mm3, (%0, %%"REG_c") \n\t" // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2372
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2373 "4: \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2374
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
2375 :: "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
2376 : "%"REG_a, "%"REG_d, "%"REG_c, "memory"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2377 );
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
2378 #else //HAVE_MMX2 || HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2379 {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2380 int y;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2381 int d=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2382 // int sysd=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2383 int i;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2384
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2385 for(y=0; y<8; y++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2386 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2387 for(x=0; x<8; x++){
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2388 int ref= tempBlurred[ x + y*stride ];
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2389 int cur= src[ x + y*stride ];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2390 int d1=ref - cur;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2391 // if(x==0 || x==7) d1+= d1>>1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2392 // if(y==0 || y==7) d1+= d1>>1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2393 // d+= FFABS(d1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2394 d+= d1*d1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2395 // sysd+= d1;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2396 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2397 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2398 i=d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2399 d= (
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2400 4*d
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2401 +(*(tempBlurredPast-256))
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2402 +(*(tempBlurredPast-1))+ (*(tempBlurredPast+1))
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2403 +(*(tempBlurredPast+256))
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2404 +4)>>3;
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2405 *tempBlurredPast=i;
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2406 // ((*tempBlurredPast)*3 + d + 2)>>2;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2407
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2408 /*
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2409 Switch between
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2410 1 0 0 0 0 0 0 (0)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2411 64 32 16 8 4 2 1 (1)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2412 64 48 36 27 20 15 11 (33) (approx)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2413 64 56 49 43 37 33 29 (200) (approx)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2414 */
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2415 if(d > maxNoise[1]){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2416 if(d < maxNoise[2]){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2417 for(y=0; y<8; y++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2418 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2419 for(x=0; x<8; x++){
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2420 int ref= tempBlurred[ x + y*stride ];
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2421 int cur= src[ x + y*stride ];
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2422 tempBlurred[ x + y*stride ]=
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2423 src[ x + y*stride ]=
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2424 (ref + cur + 1)>>1;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2425 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2426 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2427 }else{
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2428 for(y=0; y<8; y++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2429 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2430 for(x=0; x<8; x++){
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2431 tempBlurred[ x + y*stride ]= src[ x + y*stride ];
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2432 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2433 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2434 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2435 }else{
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2436 if(d < maxNoise[0]){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2437 for(y=0; y<8; y++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2438 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2439 for(x=0; x<8; x++){
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2440 int ref= tempBlurred[ x + y*stride ];
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2441 int cur= src[ x + y*stride ];
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2442 tempBlurred[ x + y*stride ]=
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2443 src[ x + y*stride ]=
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2444 (ref*7 + cur + 4)>>3;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2445 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2446 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2447 }else{
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2448 for(y=0; y<8; y++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2449 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2450 for(x=0; x<8; x++){
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2451 int ref= tempBlurred[ x + y*stride ];
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2452 int cur= src[ x + y*stride ];
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
2453 tempBlurred[ x + y*stride ]=
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2454 src[ x + y*stride ]=
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2455 (ref*3 + cur + 2)>>2;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2456 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2457 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2458 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2459 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2460 }
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
2461 #endif //HAVE_MMX2 || HAVE_AMD3DNOW
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2462 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2463 #endif //HAVE_ALTIVEC
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2464
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
2465 #if HAVE_MMX
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2466 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2467 * accurate deblock filter
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2468 */
38
63d07317cd7a rename always_inline to av_always_inline and move to common.h
mru
parents: 32
diff changeset
2469 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
2470 int64_t dc_mask, eq_mask, both_masks;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2471 int64_t sums[10*8*2];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2472 src+= step*3; // src points to begin of the 8x8 Block
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2473 //START_TIMER
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
2474 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2475 "movq %0, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2476 "movq %1, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2477 : : "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
2478 );
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2479
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
2480 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2481 "lea (%2, %3), %%"REG_a" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2482 // 0 1 2 3 4 5 6 7 8 9
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2483 // %1 eax eax+%2 eax+2%2 %1+4%2 ecx ecx+%2 ecx+2%2 %1+8%2 ecx+4%2
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2484
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2485 "movq (%2), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2486 "movq (%%"REG_a"), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2487 "movq %%mm1, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2488 "movq %%mm1, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2489 "psubb %%mm1, %%mm0 \n\t" // mm0 = differnece
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2490 "paddb %%mm7, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2491 "pcmpgtb %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2492
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2493 "movq (%%"REG_a",%3), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2494 PMAXUB(%%mm2, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2495 PMINUB(%%mm2, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2496 "psubb %%mm2, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2497 "paddb %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2498 "pcmpgtb %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2499 "paddb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2500
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2501 "movq (%%"REG_a", %3, 2), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2502 PMAXUB(%%mm1, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2503 PMINUB(%%mm1, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2504 "psubb %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2505 "paddb %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2506 "pcmpgtb %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2507 "paddb %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2508
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2509 "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
2510
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2511 "movq (%2, %3, 4), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2512 PMAXUB(%%mm2, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2513 PMINUB(%%mm2, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2514 "psubb %%mm2, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2515 "paddb %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2516 "pcmpgtb %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2517 "paddb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2518
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2519 "movq (%%"REG_a"), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2520 PMAXUB(%%mm1, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2521 PMINUB(%%mm1, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2522 "psubb %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2523 "paddb %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2524 "pcmpgtb %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2525 "paddb %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2526
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2527 "movq (%%"REG_a", %3), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2528 PMAXUB(%%mm2, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2529 PMINUB(%%mm2, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2530 "psubb %%mm2, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2531 "paddb %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2532 "pcmpgtb %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2533 "paddb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2534
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2535 "movq (%%"REG_a", %3, 2), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2536 PMAXUB(%%mm1, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2537 PMINUB(%%mm1, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2538 "psubb %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2539 "paddb %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2540 "pcmpgtb %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2541 "paddb %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2542
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2543 "movq (%2, %3, 8), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2544 PMAXUB(%%mm2, %%mm4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2545 PMINUB(%%mm2, %%mm3, %%mm5)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2546 "psubb %%mm2, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2547 "paddb %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2548 "pcmpgtb %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2549 "paddb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2550
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2551 "movq (%%"REG_a", %3, 4), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2552 "psubb %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2553 "paddb %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2554 "pcmpgtb %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2555 "paddb %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2556 "psubusb %%mm3, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2557
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2558 "pxor %%mm6, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2559 "movq %4, %%mm7 \n\t" // QP,..., QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2560 "paddusb %%mm7, %%mm7 \n\t" // 2QP ... 2QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2561 "psubusb %%mm4, %%mm7 \n\t" // Diff >=2QP -> 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2562 "pcmpeqb %%mm6, %%mm7 \n\t" // Diff < 2QP -> 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2563 "pcmpeqb %%mm6, %%mm7 \n\t" // Diff < 2QP -> 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2564 "movq %%mm7, %1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2565
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2566 "movq %5, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2567 "punpcklbw %%mm7, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2568 "punpcklbw %%mm7, %%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 "psubb %%mm0, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2571 "pcmpgtb %%mm7, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2572 "movq %%mm6, %0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2573
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2574 : "=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
2575 : "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
2576 : "%"REG_a
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2577 );
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2578
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2579 both_masks = dc_mask & eq_mask;
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 if(both_masks){
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
2582 x86_reg offset= -8*step;
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2583 int64_t *temp_sums= sums;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2584
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
2585 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2586 "movq %2, %%mm0 \n\t" // QP,..., QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2587 "pxor %%mm4, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2588
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2589 "movq (%0), %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2590 "movq (%0, %1), %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2591 "movq %%mm5, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2592 "movq %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2593 "psubusb %%mm6, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2594 "psubusb %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2595 "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
2596 "psubusb %%mm2, %%mm0 \n\t" // diff >= QP -> 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2597 "pcmpeqb %%mm4, %%mm0 \n\t" // diff >= QP -> FF
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2598
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2599 "pxor %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2600 "pand %%mm0, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2601 "pxor %%mm1, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2602 // 0:QP 6:First
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2603
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2604 "movq (%0, %1, 8), %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2605 "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
2606 "movq (%0, %1, 8), %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2607 "movq %%mm5, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2608 "movq %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2609 "psubusb %%mm7, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2610 "psubusb %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2611 "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
2612 "movq %2, %%mm0 \n\t" // QP,..., QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2613 "psubusb %%mm2, %%mm0 \n\t" // diff >= QP -> 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2614 "pcmpeqb %%mm4, %%mm0 \n\t" // diff >= QP -> FF
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2615
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2616 "pxor %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2617 "pand %%mm0, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2618 "pxor %%mm1, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2619
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2620 "movq %%mm6, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2621 "punpckhbw %%mm4, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2622 "punpcklbw %%mm4, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2623 // 4:0 5/6:First 7:Last
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2624
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2625 "movq %%mm5, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2626 "movq %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2627 "psllw $2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2628 "psllw $2, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2629 "paddw "MANGLE(w04)", %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2630 "paddw "MANGLE(w04)", %%mm1 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2631
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2632 #define NEXT\
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2633 "movq (%0), %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2634 "movq (%0), %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2635 "add %1, %0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2636 "punpcklbw %%mm4, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2637 "punpckhbw %%mm4, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2638 "paddw %%mm2, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2639 "paddw %%mm3, %%mm1 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2640
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2641 #define PREV\
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2642 "movq (%0), %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2643 "movq (%0), %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2644 "add %1, %0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2645 "punpcklbw %%mm4, %%mm2 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2646 "punpckhbw %%mm4, %%mm3 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2647 "psubw %%mm2, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2648 "psubw %%mm3, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2649
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2650
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2651 NEXT //0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2652 NEXT //1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2653 NEXT //2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2654 "movq %%mm0, (%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2655 "movq %%mm1, 8(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2656
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2657 NEXT //3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2658 "psubw %%mm5, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2659 "psubw %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2660 "movq %%mm0, 16(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2661 "movq %%mm1, 24(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2662
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2663 NEXT //4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2664 "psubw %%mm5, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2665 "psubw %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2666 "movq %%mm0, 32(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2667 "movq %%mm1, 40(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2668
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2669 NEXT //5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2670 "psubw %%mm5, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2671 "psubw %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2672 "movq %%mm0, 48(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2673 "movq %%mm1, 56(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2674
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2675 NEXT //6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2676 "psubw %%mm5, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2677 "psubw %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2678 "movq %%mm0, 64(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2679 "movq %%mm1, 72(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2680
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2681 "movq %%mm7, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2682 "punpckhbw %%mm4, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2683 "punpcklbw %%mm4, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2684
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2685 NEXT //7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2686 "mov %4, %0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2687 "add %1, %0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2688 PREV //0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2689 "movq %%mm0, 80(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2690 "movq %%mm1, 88(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2691
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2692 PREV //1
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2693 "paddw %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2694 "paddw %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2695 "movq %%mm0, 96(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2696 "movq %%mm1, 104(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2697
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2698 PREV //2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2699 "paddw %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2700 "paddw %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2701 "movq %%mm0, 112(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2702 "movq %%mm1, 120(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2703
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2704 PREV //3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2705 "paddw %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2706 "paddw %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2707 "movq %%mm0, 128(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2708 "movq %%mm1, 136(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2709
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2710 PREV //4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2711 "paddw %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2712 "paddw %%mm7, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2713 "movq %%mm0, 144(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2714 "movq %%mm1, 152(%3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2715
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2716 "mov %4, %0 \n\t" //FIXME
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 : "+&r"(src)
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
2719 : "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
2720 );
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2721
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2722 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
2723
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
2724 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2725 "movq %4, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2726 "pcmpeqb %%mm5, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2727 "pxor %%mm6, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2728 "pxor %%mm7, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2729
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2730 "1: \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2731 "movq (%1), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2732 "movq 8(%1), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2733 "paddw 32(%1), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2734 "paddw 40(%1), %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2735 "movq (%0, %3), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2736 "movq %%mm2, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2737 "movq %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2738 "punpcklbw %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2739 "punpckhbw %%mm7, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2740 "paddw %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2741 "paddw %%mm3, %%mm1 \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 "psrlw $4, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2745 "psrlw $4, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2746 "packuswb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2747 "pand %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2748 "pand %%mm5, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2749 "por %%mm4, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2750 "movq %%mm0, (%0, %3) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2751 "add $16, %1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2752 "add %2, %0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2753 " js 1b \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2754
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2755 : "+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
2756 : "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
2757 );
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2758 }else
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2759 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
2760
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2761 if(eq_mask != -1LL){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2762 uint8_t *temp_src= src;
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
2763 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2764 "pxor %%mm7, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2765 "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
2766 "and "ALIGN_MASK", %%"REG_c" \n\t" // align
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2767 // 0 1 2 3 4 5 6 7 8 9
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2768 // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %1+8%1 ecx+4%1
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2769
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2770 "movq (%0), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2771 "movq %%mm0, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2772 "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
2773 "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
2774
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2775 "movq (%0, %1), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2776 "lea (%0, %1, 2), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2777 "movq %%mm2, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2778 "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
2779 "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
2780
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2781 "movq (%%"REG_a"), %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2782 "movq %%mm4, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2783 "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
2784 "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
2785
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2786 "paddw %%mm0, %%mm0 \n\t" // 2L0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2787 "paddw %%mm1, %%mm1 \n\t" // 2H0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2788 "psubw %%mm4, %%mm2 \n\t" // L1 - L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2789 "psubw %%mm5, %%mm3 \n\t" // H1 - H2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2790 "psubw %%mm2, %%mm0 \n\t" // 2L0 - L1 + L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2791 "psubw %%mm3, %%mm1 \n\t" // 2H0 - H1 + H2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2792
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2793 "psllw $2, %%mm2 \n\t" // 4L1 - 4L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2794 "psllw $2, %%mm3 \n\t" // 4H1 - 4H2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2795 "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2796 "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2797
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2798 "movq (%%"REG_a", %1), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2799 "movq %%mm2, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2800 "punpcklbw %%mm7, %%mm2 \n\t" // L3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2801 "punpckhbw %%mm7, %%mm3 \n\t" // H3
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2802
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2803 "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
2804 "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
2805 "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
2806 "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
2807 "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
2808 "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
2809
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2810 "movq (%%"REG_a", %1, 2), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2811 "movq %%mm0, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2812 "punpcklbw %%mm7, %%mm0 \n\t" // L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2813 "punpckhbw %%mm7, %%mm1 \n\t" // H4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2814
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2815 "psubw %%mm0, %%mm2 \n\t" // L3 - L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2816 "psubw %%mm1, %%mm3 \n\t" // H3 - H4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2817 "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
2818 "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
2819 "paddw %%mm4, %%mm4 \n\t" // 2L2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2820 "paddw %%mm5, %%mm5 \n\t" // 2H2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2821 "psubw %%mm2, %%mm4 \n\t" // 2L2 - L3 + L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2822 "psubw %%mm3, %%mm5 \n\t" // 2H2 - H3 + H4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2823
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2824 "lea (%%"REG_a", %1), %0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2825 "psllw $2, %%mm2 \n\t" // 4L3 - 4L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2826 "psllw $2, %%mm3 \n\t" // 4H3 - 4H4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2827 "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2828 "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2829 //50 opcodes so far
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2830 "movq (%0, %1, 2), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2831 "movq %%mm2, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2832 "punpcklbw %%mm7, %%mm2 \n\t" // L5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2833 "punpckhbw %%mm7, %%mm3 \n\t" // H5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2834 "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
2835 "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
2836 "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
2837 "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
2838
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2839 "movq (%%"REG_a", %1, 4), %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2840 "punpcklbw %%mm7, %%mm6 \n\t" // L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2841 "psubw %%mm6, %%mm2 \n\t" // L5 - L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2842 "movq (%%"REG_a", %1, 4), %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2843 "punpckhbw %%mm7, %%mm6 \n\t" // H6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2844 "psubw %%mm6, %%mm3 \n\t" // H5 - H6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2845
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2846 "paddw %%mm0, %%mm0 \n\t" // 2L4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2847 "paddw %%mm1, %%mm1 \n\t" // 2H4
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2848 "psubw %%mm2, %%mm0 \n\t" // 2L4 - L5 + L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2849 "psubw %%mm3, %%mm1 \n\t" // 2H4 - H5 + H6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2850
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2851 "psllw $2, %%mm2 \n\t" // 4L5 - 4L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2852 "psllw $2, %%mm3 \n\t" // 4H5 - 4H6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2853 "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2854 "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2855
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2856 "movq (%0, %1, 4), %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2857 "movq %%mm2, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2858 "punpcklbw %%mm7, %%mm2 \n\t" // L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2859 "punpckhbw %%mm7, %%mm3 \n\t" // H7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2860
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2861 "paddw %%mm2, %%mm2 \n\t" // 2L7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2862 "paddw %%mm3, %%mm3 \n\t" // 2H7
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2863 "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
2864 "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
2865
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2866 "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
2867 "movq 8(%%"REG_c"), %%mm3 \n\t" // 2H0 - 5H1 + 5H2 - 2H3
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2868
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
2869 #if HAVE_MMX2
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2870 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2871 "psubw %%mm0, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2872 "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
2873 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2874 "psubw %%mm1, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2875 "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
2876 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2877 "psubw %%mm2, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2878 "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
2879 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2880 "psubw %%mm3, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2881 "pmaxsw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3|
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2882 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2883 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2884 "pcmpgtw %%mm0, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2885 "pxor %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2886 "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
2887 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2888 "pcmpgtw %%mm1, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2889 "pxor %%mm6, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2890 "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
2891 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2892 "pcmpgtw %%mm2, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2893 "pxor %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2894 "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
2895 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2896 "pcmpgtw %%mm3, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2897 "pxor %%mm6, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2898 "psubw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3|
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2899 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2900
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
2901 #if HAVE_MMX2
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2902 "pminsw %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2903 "pminsw %%mm3, %%mm1 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2904 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2905 "movq %%mm0, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2906 "psubusw %%mm2, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2907 "psubw %%mm6, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2908 "movq %%mm1, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2909 "psubusw %%mm3, %%mm6 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2910 "psubw %%mm6, %%mm1 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2911 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2912
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2913 "movd %2, %%mm2 \n\t" // QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2914 "punpcklbw %%mm7, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2915
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2916 "movq %%mm7, %%mm6 \n\t" // 0
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2917 "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
2918 "pxor %%mm6, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2919 "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
2920 "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
2921 "pxor %%mm7, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2922 "psubw %%mm7, %%mm5 \n\t" // |2H2 - 5H3 + 5H4 - 2H5|
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2923 // 100 opcodes
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2924 "psllw $3, %%mm2 \n\t" // 8QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2925 "movq %%mm2, %%mm3 \n\t" // 8QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2926 "pcmpgtw %%mm4, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2927 "pcmpgtw %%mm5, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2928 "pand %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2929 "pand %%mm3, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2930
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2931
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2932 "psubusw %%mm0, %%mm4 \n\t" // hd
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2933 "psubusw %%mm1, %%mm5 \n\t" // ld
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2934
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2935
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2936 "movq "MANGLE(w05)", %%mm2 \n\t" // 5
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2937 "pmullw %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2938 "pmullw %%mm2, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2939 "movq "MANGLE(w20)", %%mm2 \n\t" // 32
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2940 "paddw %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2941 "paddw %%mm2, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2942 "psrlw $6, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2943 "psrlw $6, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2944
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2945 "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
2946 "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
2947
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2948 "pxor %%mm2, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2949 "pxor %%mm3, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2950
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2951 "pcmpgtw %%mm0, %%mm2 \n\t" // sign (L3-L4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2952 "pcmpgtw %%mm1, %%mm3 \n\t" // sign (H3-H4)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2953 "pxor %%mm2, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2954 "pxor %%mm3, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2955 "psubw %%mm2, %%mm0 \n\t" // |L3-L4|
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2956 "psubw %%mm3, %%mm1 \n\t" // |H3-H4|
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2957 "psrlw $1, %%mm0 \n\t" // |L3 - L4|/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2958 "psrlw $1, %%mm1 \n\t" // |H3 - H4|/2
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2959
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2960 "pxor %%mm6, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2961 "pxor %%mm7, %%mm3 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2962 "pand %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2963 "pand %%mm3, %%mm5 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2964
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
2965 #if HAVE_MMX2
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2966 "pminsw %%mm0, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2967 "pminsw %%mm1, %%mm5 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2968 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2969 "movq %%mm4, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2970 "psubusw %%mm0, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2971 "psubw %%mm2, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2972 "movq %%mm5, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2973 "psubusw %%mm1, %%mm2 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2974 "psubw %%mm2, %%mm5 \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2975 #endif
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2976 "pxor %%mm6, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2977 "pxor %%mm7, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2978 "psubw %%mm6, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2979 "psubw %%mm7, %%mm5 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2980 "packsswb %%mm5, %%mm4 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2981 "movq %3, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2982 "pandn %%mm4, %%mm1 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2983 "movq (%0), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2984 "paddb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2985 "movq %%mm0, (%0) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2986 "movq (%0, %1), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2987 "psubb %%mm1, %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2988 "movq %%mm0, (%0, %1) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2989
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2990 : "+r" (temp_src)
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
2991 : "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
2992 : "%"REG_a, "%"REG_c
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2993 );
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
2994 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2995 /*if(step==16){
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2996 STOP_TIMER("step16")
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2997 }else{
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2998 STOP_TIMER("stepX")
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
2999 }*/
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3000 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3001 #endif //HAVE_MMX
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3002
78
michael
parents: 55
diff changeset
3003 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
3004 const QP_STORE_T QPs[], int QPStride, int isColor, PPContext *c);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3005
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3006 /**
48
72675332ed82 misc spelling fixes
diego
parents: 45
diff changeset
3007 * Copies a block from src to dst and fixes the blacklevel.
72675332ed82 misc spelling fixes
diego
parents: 45
diff changeset
3008 * levelFix == 0 -> do not touch the brighness & contrast
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3009 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3010 #undef SCALED_CPY
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3011
78
michael
parents: 55
diff changeset
3012 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
3013 int levelFix, int64_t *packedOffsetAndScale)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3014 {
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3015 #if !HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3016 int i;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3017 #endif
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3018 if(levelFix){
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3019 #if HAVE_MMX
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
3020 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3021 "movq (%%"REG_a"), %%mm2 \n\t" // packedYOffset
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3022 "movq 8(%%"REG_a"), %%mm3 \n\t" // packedYScale
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3023 "lea (%2,%4), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3024 "lea (%3,%5), %%"REG_d" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3025 "pxor %%mm4, %%mm4 \n\t"
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3026 #if HAVE_MMX2
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3027 #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
3028 "movq " #src1 ", %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3029 "movq " #src1 ", %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3030 "movq " #src2 ", %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3031 "movq " #src2 ", %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3032 "punpcklbw %%mm0, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3033 "punpckhbw %%mm5, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3034 "punpcklbw %%mm1, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3035 "punpckhbw %%mm6, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3036 "pmulhuw %%mm3, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3037 "pmulhuw %%mm3, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3038 "pmulhuw %%mm3, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3039 "pmulhuw %%mm3, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3040 "psubw %%mm2, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3041 "psubw %%mm2, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3042 "psubw %%mm2, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3043 "psubw %%mm2, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3044 "packuswb %%mm5, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3045 "packuswb %%mm6, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3046 "movq %%mm0, " #dst1 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3047 "movq %%mm1, " #dst2 " \n\t"\
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3048
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3049 #else //HAVE_MMX2
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3050 #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
3051 "movq " #src1 ", %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3052 "movq " #src1 ", %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3053 "punpcklbw %%mm4, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3054 "punpckhbw %%mm4, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3055 "psubw %%mm2, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3056 "psubw %%mm2, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3057 "movq " #src2 ", %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3058 "psllw $6, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3059 "psllw $6, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3060 "pmulhw %%mm3, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3061 "movq " #src2 ", %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3062 "pmulhw %%mm3, %%mm5 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3063 "punpcklbw %%mm4, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3064 "punpckhbw %%mm4, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3065 "psubw %%mm2, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3066 "psubw %%mm2, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3067 "psllw $6, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3068 "psllw $6, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3069 "pmulhw %%mm3, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3070 "pmulhw %%mm3, %%mm6 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3071 "packuswb %%mm5, %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3072 "packuswb %%mm6, %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3073 "movq %%mm0, " #dst1 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3074 "movq %%mm1, " #dst2 " \n\t"\
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3075
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3076 #endif //HAVE_MMX2
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3077 #define SCALED_CPY(src1, src2, dst1, dst2)\
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3078 REAL_SCALED_CPY(src1, src2, dst1, dst2)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3079
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3080 SCALED_CPY((%2) , (%2, %4) , (%3) , (%3, %5))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3081 SCALED_CPY((%2, %4, 2), (%%REGa, %4, 2), (%3, %5, 2), (%%REGd, %5, 2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3082 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
3083 "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
3084 "lea (%%"REG_d",%5,4), %%"REG_d" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3085 SCALED_CPY((%%REGa, %4), (%%REGa, %4, 2), (%%REGd, %5), (%%REGd, %5, 2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3086
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3087
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3088 : "=&a" (packedOffsetAndScale)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3089 : "0" (packedOffsetAndScale),
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3090 "r"(src),
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3091 "r"(dst),
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
3092 "r" ((x86_reg)srcStride),
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
3093 "r" ((x86_reg)dstStride)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3094 : "%"REG_d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3095 );
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3096 #else //HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3097 for(i=0; i<8; i++)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3098 memcpy( &(dst[dstStride*i]),
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3099 &(src[srcStride*i]), BLOCK_SIZE);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3100 #endif //HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3101 }else{
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3102 #if HAVE_MMX
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
3103 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3104 "lea (%0,%2), %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3105 "lea (%1,%3), %%"REG_d" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3106
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3107 #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
3108 "movq " #src1 ", %%mm0 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3109 "movq " #src2 ", %%mm1 \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3110 "movq %%mm0, " #dst1 " \n\t"\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3111 "movq %%mm1, " #dst2 " \n\t"\
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3112
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3113 #define SIMPLE_CPY(src1, src2, dst1, dst2)\
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3114 REAL_SIMPLE_CPY(src1, src2, dst1, dst2)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3115
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3116 SIMPLE_CPY((%0) , (%0, %2) , (%1) , (%1, %3))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3117 SIMPLE_CPY((%0, %2, 2), (%%REGa, %2, 2), (%1, %3, 2), (%%REGd, %3, 2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3118 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
3119 "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
3120 "lea (%%"REG_d",%3,4), %%"REG_d" \n\t"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3121 SIMPLE_CPY((%%REGa, %2), (%%REGa, %2, 2), (%%REGd, %3), (%%REGd, %3, 2))
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3122
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3123 : : "r" (src),
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3124 "r" (dst),
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
3125 "r" ((x86_reg)srcStride),
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
3126 "r" ((x86_reg)dstStride)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3127 : "%"REG_a, "%"REG_d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3128 );
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3129 #else //HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3130 for(i=0; i<8; i++)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3131 memcpy( &(dst[dstStride*i]),
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3132 &(src[srcStride*i]), BLOCK_SIZE);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3133 #endif //HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3134 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3135 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3136
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3137 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3138 * Duplicates the given 8 src pixels ? times upward
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3139 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3140 static inline void RENAME(duplicate)(uint8_t src[], int stride)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3141 {
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3142 #if HAVE_MMX
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
3143 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3144 "movq (%0), %%mm0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3145 "add %1, %0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3146 "movq %%mm0, (%0) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3147 "movq %%mm0, (%0, %1) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3148 "movq %%mm0, (%0, %1, 2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3149 : "+r" (src)
113
bf8f52662dc3 Replace long with x86_reg in postprocess_template.c like in all other
reimar
parents: 112
diff changeset
3150 : "r" ((x86_reg)-stride)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3151 );
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3152 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3153 int i;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3154 uint8_t *p=src;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3155 for(i=0; i<3; i++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3156 p-= stride;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3157 memcpy(p, src, 8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3158 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3159 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3160 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3161
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3162 /**
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3163 * Filters array of bytes (Y or U or V values)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3164 */
78
michael
parents: 55
diff changeset
3165 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
3166 const QP_STORE_T QPs[], int QPStride, int isColor, PPContext *c2)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3167 {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3168 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
3169 int x,y;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3170 #ifdef COMPILE_TIME_MODE
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3171 const int mode= COMPILE_TIME_MODE;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3172 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3173 const int mode= isColor ? c.ppMode.chromMode : c.ppMode.lumMode;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3174 #endif
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3175 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
3176 int QPCorrecture= 256*256;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3177
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3178 int copyAhead;
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3179 #if HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3180 int i;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3181 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3182
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3183 const int qpHShift= isColor ? 4-c.hChromaSubSample : 4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3184 const int qpVShift= isColor ? 4-c.vChromaSubSample : 4;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3185
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3186 //FIXME remove
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3187 uint64_t * const yHistogram= c.yHistogram;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3188 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
3189 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
3190 //const int mbWidth= isColor ? (width+7)>>3 : (width+15)>>4;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3191
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3192 #if HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3193 for(i=0; i<57; i++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3194 int offset= ((i*c.ppMode.baseDcDiff)>>8) + 1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3195 int threshold= offset*2 + 1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3196 c.mmxDcOffset[i]= 0x7F - offset;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3197 c.mmxDcThreshold[i]= 0x7F - threshold;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3198 c.mmxDcOffset[i]*= 0x0101010101010101LL;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3199 c.mmxDcThreshold[i]*= 0x0101010101010101LL;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3200 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3201 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3202
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3203 if(mode & CUBIC_IPOL_DEINT_FILTER) copyAhead=16;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3204 else if( (mode & LINEAR_BLEND_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3205 || (mode & FFMPEG_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3206 || (mode & LOWPASS5_DEINT_FILTER)) copyAhead=14;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3207 else if( (mode & V_DEBLOCK)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3208 || (mode & LINEAR_IPOL_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3209 || (mode & MEDIAN_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3210 || (mode & V_A_DEBLOCK)) copyAhead=13;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3211 else if(mode & V_X1_FILTER) copyAhead=11;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3212 // else if(mode & V_RK1_FILTER) copyAhead=10;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3213 else if(mode & DERING) copyAhead=9;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3214 else copyAhead=8;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3215
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3216 copyAhead-= 8;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3217
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3218 if(!isColor){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3219 uint64_t sum= 0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3220 int i;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3221 uint64_t maxClipped;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3222 uint64_t clipped;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3223 double scale;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3224
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3225 c.frameNum++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3226 // first frame is fscked so we ignore it
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3227 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
3228
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3229 for(i=0; i<256; i++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3230 sum+= yHistogram[i];
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
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3233 /* We always get a completely black picture first. */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3234 maxClipped= (uint64_t)(sum * c.ppMode.maxClippedThreshold);
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 clipped= sum;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3237 for(black=255; black>0; black--){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3238 if(clipped < maxClipped) break;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3239 clipped-= yHistogram[black];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3240 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3241
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3242 clipped= sum;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3243 for(white=0; white<256; white++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3244 if(clipped < maxClipped) break;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3245 clipped-= yHistogram[white];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3246 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3247
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3248 scale= (double)(c.ppMode.maxAllowedY - c.ppMode.minAllowedY) / (double)(white-black);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3249
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3250 #if HAVE_MMX2
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3251 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
3252 c.packedYOffset= (((black*c.packedYScale)>>8) - c.ppMode.minAllowedY) & 0xFFFF;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3253 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3254 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
3255 c.packedYOffset= (black - c.ppMode.minAllowedY) & 0xFFFF;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3256 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3257
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3258 c.packedYOffset|= c.packedYOffset<<32;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3259 c.packedYOffset|= c.packedYOffset<<16;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3260
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3261 c.packedYScale|= c.packedYScale<<32;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3262 c.packedYScale|= c.packedYScale<<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 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
3265 else QPCorrecture= 256*256;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3266 }else{
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3267 c.packedYScale= 0x0100010001000100LL;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3268 c.packedYOffset= 0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3269 QPCorrecture= 256*256;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3270 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3271
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3272 /* copy & deinterlace first row of blocks */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3273 y=-BLOCK_SIZE;
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 const uint8_t *srcBlock= &(src[y*srcStride]);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3276 uint8_t *dstBlock= tempDst + dstStride;
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 // 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
3279 // 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
3280 // 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
3281 for(x=0; x<width; x+=BLOCK_SIZE){
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3282
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3283 #if HAVE_MMX2
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3284 /*
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3285 prefetchnta(srcBlock + (((x>>2)&6) + 5)*srcStride + 32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3286 prefetchnta(srcBlock + (((x>>2)&6) + 6)*srcStride + 32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3287 prefetcht0(dstBlock + (((x>>2)&6) + 5)*dstStride + 32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3288 prefetcht0(dstBlock + (((x>>2)&6) + 6)*dstStride + 32);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3289 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3290
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
3291 __asm__(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3292 "mov %4, %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3293 "shr $2, %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3294 "and $6, %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3295 "add %5, %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3296 "mov %%"REG_a", %%"REG_d" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3297 "imul %1, %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3298 "imul %3, %%"REG_d" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3299 "prefetchnta 32(%%"REG_a", %0) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3300 "prefetcht0 32(%%"REG_d", %2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3301 "add %1, %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3302 "add %3, %%"REG_d" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3303 "prefetchnta 32(%%"REG_a", %0) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3304 "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
3305 :: "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
3306 "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
3307 : "%"REG_a, "%"REG_d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3308 );
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3309
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
3310 #elif HAVE_AMD3DNOW
49
cdfe8fc50090 misc typo fixes
diego
parents: 48
diff changeset
3311 //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
3312 /* prefetch(srcBlock + (((x>>3)&3) + 5)*srcStride + 32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3313 prefetch(srcBlock + (((x>>3)&3) + 9)*srcStride + 32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3314 prefetchw(dstBlock + (((x>>3)&3) + 5)*dstStride + 32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3315 prefetchw(dstBlock + (((x>>3)&3) + 9)*dstStride + 32);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3316 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3317 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3318
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3319 RENAME(blockCopy)(dstBlock + dstStride*8, dstStride,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3320 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
3321
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3322 RENAME(duplicate)(dstBlock + dstStride*8, dstStride);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3323
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3324 if(mode & LINEAR_IPOL_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3325 RENAME(deInterlaceInterpolateLinear)(dstBlock, dstStride);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3326 else if(mode & LINEAR_BLEND_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3327 RENAME(deInterlaceBlendLinear)(dstBlock, dstStride, c.deintTemp + x);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3328 else if(mode & MEDIAN_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3329 RENAME(deInterlaceMedian)(dstBlock, dstStride);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3330 else if(mode & CUBIC_IPOL_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3331 RENAME(deInterlaceInterpolateCubic)(dstBlock, dstStride);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3332 else if(mode & FFMPEG_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3333 RENAME(deInterlaceFF)(dstBlock, dstStride, c.deintTemp + x);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3334 else if(mode & LOWPASS5_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3335 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
3336 /* else if(mode & CUBIC_BLEND_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3337 RENAME(deInterlaceBlendCubic)(dstBlock, dstStride);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3338 */
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3339 dstBlock+=8;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3340 srcBlock+=8;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3341 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3342 if(width==FFABS(dstStride))
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3343 linecpy(dst, tempDst + 9*dstStride, copyAhead, dstStride);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3344 else{
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3345 int i;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3346 for(i=0; i<copyAhead; i++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3347 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
3348 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3349 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3350 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3351
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3352 for(y=0; y<height; y+=BLOCK_SIZE){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3353 //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
3354 const uint8_t *srcBlock= &(src[y*srcStride]);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3355 uint8_t *dstBlock= &(dst[y*dstStride]);
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3356 #if HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3357 uint8_t *tempBlock1= c.tempBlocks;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3358 uint8_t *tempBlock2= c.tempBlocks + 8;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3359 #endif
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3360 const int8_t *QPptr= &QPs[(y>>qpVShift)*QPStride];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3361 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
3362 int QP=0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3363 /* 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
3364 if not than use a temporary buffer */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3365 if(y+15 >= height){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3366 int i;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3367 /* 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
3368 blockcopy to dst later */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3369 linecpy(tempSrc + srcStride*copyAhead, srcBlock + srcStride*copyAhead,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3370 FFMAX(height-y-copyAhead, 0), srcStride);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3371
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3372 /* 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
3373 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
3374 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
3375
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3376 /* 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
3377 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
3378
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3379 /* 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
3380 for(i=height-y+1; i<=copyAhead; i++)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3381 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
3382
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3383 dstBlock= tempDst + dstStride;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3384 srcBlock= tempSrc;
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
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3387 // 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
3388 // 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
3389 // 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
3390 for(x=0; x<width; x+=BLOCK_SIZE){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3391 const int stride= dstStride;
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3392 #if HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3393 uint8_t *tmpXchg;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3394 #endif
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3395 if(isColor){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3396 QP= QPptr[x>>qpHShift];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3397 c.nonBQP= nonBQPptr[x>>qpHShift];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3398 }else{
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3399 QP= QPptr[x>>4];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3400 QP= (QP* QPCorrecture + 256*128)>>16;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3401 c.nonBQP= nonBQPptr[x>>4];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3402 c.nonBQP= (c.nonBQP* QPCorrecture + 256*128)>>16;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3403 yHistogram[ srcBlock[srcStride*12 + 4] ]++;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3404 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3405 c.QP= QP;
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3406 #if HAVE_MMX
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
3407 __asm__ volatile(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3408 "movd %1, %%mm7 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3409 "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
3410 "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
3411 "packuswb %%mm7, %%mm7 \n\t" // QP,..., QP
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3412 "movq %%mm7, %0 \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3413 : "=m" (c.pQPb)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3414 : "r" (QP)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3415 );
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3416 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3417
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3418
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3419 #if HAVE_MMX2
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3420 /*
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3421 prefetchnta(srcBlock + (((x>>2)&6) + 5)*srcStride + 32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3422 prefetchnta(srcBlock + (((x>>2)&6) + 6)*srcStride + 32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3423 prefetcht0(dstBlock + (((x>>2)&6) + 5)*dstStride + 32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3424 prefetcht0(dstBlock + (((x>>2)&6) + 6)*dstStride + 32);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3425 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3426
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
3427 __asm__(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3428 "mov %4, %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3429 "shr $2, %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3430 "and $6, %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3431 "add %5, %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3432 "mov %%"REG_a", %%"REG_d" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3433 "imul %1, %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3434 "imul %3, %%"REG_d" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3435 "prefetchnta 32(%%"REG_a", %0) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3436 "prefetcht0 32(%%"REG_d", %2) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3437 "add %1, %%"REG_a" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3438 "add %3, %%"REG_d" \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3439 "prefetchnta 32(%%"REG_a", %0) \n\t"
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3440 "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
3441 :: "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
3442 "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
3443 : "%"REG_a, "%"REG_d
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3444 );
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3445
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
3446 #elif HAVE_AMD3DNOW
49
cdfe8fc50090 misc typo fixes
diego
parents: 48
diff changeset
3447 //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
3448 /* prefetch(srcBlock + (((x>>3)&3) + 5)*srcStride + 32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3449 prefetch(srcBlock + (((x>>3)&3) + 9)*srcStride + 32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3450 prefetchw(dstBlock + (((x>>3)&3) + 5)*dstStride + 32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3451 prefetchw(dstBlock + (((x>>3)&3) + 9)*dstStride + 32);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3452 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3453 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3454
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3455 RENAME(blockCopy)(dstBlock + dstStride*copyAhead, dstStride,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3456 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
3457
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3458 if(mode & LINEAR_IPOL_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3459 RENAME(deInterlaceInterpolateLinear)(dstBlock, dstStride);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3460 else if(mode & LINEAR_BLEND_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3461 RENAME(deInterlaceBlendLinear)(dstBlock, dstStride, c.deintTemp + x);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3462 else if(mode & MEDIAN_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3463 RENAME(deInterlaceMedian)(dstBlock, dstStride);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3464 else if(mode & CUBIC_IPOL_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3465 RENAME(deInterlaceInterpolateCubic)(dstBlock, dstStride);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3466 else if(mode & FFMPEG_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3467 RENAME(deInterlaceFF)(dstBlock, dstStride, c.deintTemp + x);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3468 else if(mode & LOWPASS5_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3469 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
3470 /* else if(mode & CUBIC_BLEND_DEINT_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3471 RENAME(deInterlaceBlendCubic)(dstBlock, dstStride);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3472 */
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3473
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3474 /* only deblock if we have 2 blocks */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3475 if(y + 8 < height){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3476 if(mode & V_X1_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3477 RENAME(vertX1Filter)(dstBlock, stride, &c);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3478 else if(mode & V_DEBLOCK){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3479 const int t= RENAME(vertClassify)(dstBlock, stride, &c);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3480
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3481 if(t==1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3482 RENAME(doVertLowPass)(dstBlock, stride, &c);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3483 else if(t==2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3484 RENAME(doVertDefFilter)(dstBlock, stride, &c);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3485 }else if(mode & V_A_DEBLOCK){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3486 RENAME(do_a_deblock)(dstBlock, stride, 1, &c);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3487 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3488 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3489
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3490 #if HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3491 RENAME(transpose1)(tempBlock1, tempBlock2, dstBlock, dstStride);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3492 #endif
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3493 /* 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
3494 if(x - 8 >= 0){
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3495 #if HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3496 if(mode & H_X1_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3497 RENAME(vertX1Filter)(tempBlock1, 16, &c);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3498 else if(mode & H_DEBLOCK){
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3499 //START_TIMER
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3500 const int t= RENAME(vertClassify)(tempBlock1, 16, &c);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3501 //STOP_TIMER("dc & minmax")
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3502 if(t==1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3503 RENAME(doVertLowPass)(tempBlock1, 16, &c);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3504 else if(t==2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3505 RENAME(doVertDefFilter)(tempBlock1, 16, &c);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3506 }else if(mode & H_A_DEBLOCK){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3507 RENAME(do_a_deblock)(tempBlock1, 16, 1, &c);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3508 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3509
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3510 RENAME(transpose2)(dstBlock-4, dstStride, tempBlock1 + 4*16);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3511
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3512 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3513 if(mode & H_X1_FILTER)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3514 horizX1Filter(dstBlock-4, stride, QP);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3515 else if(mode & H_DEBLOCK){
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3516 #if HAVE_ALTIVEC
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3517 DECLARE_ALIGNED(16, unsigned char, tempBlock[272]);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3518 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
3519
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3520 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
3521 if(t==1) {
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3522 doVertLowPass_altivec(tempBlock-48, 16, &c);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3523 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
3524 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3525 else if(t==2) {
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3526 doVertDefFilter_altivec(tempBlock-48, 16, &c);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3527 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
3528 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3529 #else
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3530 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
3531
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3532 if(t==1)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3533 RENAME(doHorizLowPass)(dstBlock-4, stride, &c);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3534 else if(t==2)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3535 RENAME(doHorizDefFilter)(dstBlock-4, stride, &c);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3536 #endif
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3537 }else if(mode & H_A_DEBLOCK){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3538 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
3539 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3540 #endif //HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3541 if(mode & DERING){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3542 //FIXME filter first line
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3543 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
3544 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3545
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3546 if(mode & TEMP_NOISE_FILTER)
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 RENAME(tempNoiseReducer)(dstBlock-8, stride,
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
3549 c.tempBlurred[isColor] + y*dstStride + x,
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
3550 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
3551 c.ppMode.maxTmpNoise);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3552 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3553 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3554
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3555 dstBlock+=8;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3556 srcBlock+=8;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3557
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3558 #if HAVE_MMX
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3559 tmpXchg= tempBlock1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3560 tempBlock1= tempBlock2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3561 tempBlock2 = tmpXchg;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3562 #endif
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3563 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3564
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3565 if(mode & DERING){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3566 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
3567 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3568
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3569 if((mode & TEMP_NOISE_FILTER)){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3570 RENAME(tempNoiseReducer)(dstBlock-8, dstStride,
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
3571 c.tempBlurred[isColor] + y*dstStride + x,
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 97
diff changeset
3572 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
3573 c.ppMode.maxTmpNoise);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3574 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3575
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3576 /* 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
3577 if(y+15 >= height){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3578 uint8_t *dstBlock= &(dst[y*dstStride]);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3579 if(width==FFABS(dstStride))
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3580 linecpy(dstBlock, tempDst + dstStride, height-y, dstStride);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3581 else{
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3582 int i;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3583 for(i=0; i<height-y; i++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3584 memcpy(dstBlock + i*dstStride, tempDst + (i+1)*dstStride, width);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3585 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3586 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3587 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3588 /*
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3589 for(x=0; x<width; x+=32){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3590 volatile int i;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3591 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
3592 + dstBlock[x + 9*dstStride] + dstBlock[x +10*dstStride]
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3593 + dstBlock[x +11*dstStride] + dstBlock[x +12*dstStride];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3594 + dstBlock[x +13*dstStride]
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3595 + dstBlock[x +14*dstStride] + dstBlock[x +15*dstStride];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3596 }*/
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3597 }
121
dd89aa84269b HAVE_3DNOW --> HAVE_AMD3DNOW to sync with latest configure changes.
diego
parents: 119
diff changeset
3598 #if HAVE_AMD3DNOW
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
3599 __asm__ volatile("femms");
118
bdd1788fb53b Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 113
diff changeset
3600 #elif HAVE_MMX
112
d4d919ebc31c Convert asm keyword into __asm__.
flameeyes
parents: 108
diff changeset
3601 __asm__ volatile("emms");
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3602 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3603
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3604 #ifdef DEBUG_BRIGHTNESS
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3605 if(!isColor){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3606 int max=1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3607 int i;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3608 for(i=0; i<256; i++)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3609 if(yHistogram[i] > max) max=yHistogram[i];
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3610
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3611 for(i=1; i<256; i++){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3612 int x;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3613 int start=yHistogram[i-1]/(max/256+1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3614 int end=yHistogram[i]/(max/256+1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3615 int inc= end > start ? 1 : -1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3616 for(x=start; x!=end+inc; x+=inc)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3617 dst[ i*dstStride + x]+=128;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3618 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3619
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3620 for(i=0; i<100; i+=2){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3621 dst[ (white)*dstStride + i]+=128;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3622 dst[ (black)*dstStride + i]+=128;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3623 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3624 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3625 #endif
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3626
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 92
diff changeset
3627 *c2= c; //copy local context back
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3628
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
3629 }