annotate i386/dsputil_mmx.c @ 354:167aa21aa250 libavcodec

patch by Alex Beregszaszi <alex@naxine.org> - AVID (AVRn) support (workaround) - print error instead of failing for unsupported SOF - fixed the 0<code<FF range checking
author arpi_esp
date Fri, 03 May 2002 16:34:40 +0000
parents 8635a7036395
children f49629bab18d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1 /*
986e461dc072 Initial revision
glantau
parents:
diff changeset
2 * MMX optimized DSP utils
986e461dc072 Initial revision
glantau
parents:
diff changeset
3 * Copyright (c) 2000, 2001 Gerard Lantau.
986e461dc072 Initial revision
glantau
parents:
diff changeset
4 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
986e461dc072 Initial revision
glantau
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
986e461dc072 Initial revision
glantau
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
986e461dc072 Initial revision
glantau
parents:
diff changeset
8 * (at your option) any later version.
986e461dc072 Initial revision
glantau
parents:
diff changeset
9 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
986e461dc072 Initial revision
glantau
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
986e461dc072 Initial revision
glantau
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
986e461dc072 Initial revision
glantau
parents:
diff changeset
13 * GNU General Public License for more details.
986e461dc072 Initial revision
glantau
parents:
diff changeset
14 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
986e461dc072 Initial revision
glantau
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
986e461dc072 Initial revision
glantau
parents:
diff changeset
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
986e461dc072 Initial revision
glantau
parents:
diff changeset
18 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
19 * MMX optimization by Nick Kurshev <nickols_k@mail.ru>
986e461dc072 Initial revision
glantau
parents:
diff changeset
20 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
21
986e461dc072 Initial revision
glantau
parents:
diff changeset
22 #include "../dsputil.h"
174
ac5075a55488 new IDCT code by Michael Niedermayer (michaelni@gmx.at) - #define SIMPLE_IDCT to enable
arpi_esp
parents: 151
diff changeset
23 #include "../simple_idct.h"
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
24
5
4479bcab253e suppressed no longer needed emms()
glantau
parents: 0
diff changeset
25 int mm_flags; /* multimedia extension flags */
4479bcab253e suppressed no longer needed emms()
glantau
parents: 0
diff changeset
26
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
27 int pix_abs16x16_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
28 int pix_abs16x16_x2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
29 int pix_abs16x16_y2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
30 int pix_abs16x16_xy2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
31
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
32 int pix_abs16x16_mmx2(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
33 int pix_abs16x16_x2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
34 int pix_abs16x16_y2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
35 int pix_abs16x16_xy2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
36
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
37 int pix_abs8x8_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
38 int pix_abs8x8_x2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
39 int pix_abs8x8_y2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
40 int pix_abs8x8_xy2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
41
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
42 int pix_abs8x8_mmx2(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
43 int pix_abs8x8_x2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
44 int pix_abs8x8_y2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
45 int pix_abs8x8_xy2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
46
42
8068c4bce9c1 added mmx idct
glantau
parents: 19
diff changeset
47 /* external functions, from idct_mmx.c */
8068c4bce9c1 added mmx idct
glantau
parents: 19
diff changeset
48 void ff_mmx_idct(DCTELEM *block);
8068c4bce9c1 added mmx idct
glantau
parents: 19
diff changeset
49 void ff_mmxext_idct(DCTELEM *block);
19
82d4c9be9873 MMX/MMXEXT iDCT support, using external functions currently defined in libmpeg2
arpi_esp
parents: 8
diff changeset
50
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
51 /* pixel operations */
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
52 static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001LL;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
53 static const unsigned long long int mm_wtwo __attribute__ ((aligned(8))) = 0x0002000200020002LL;
8
1b4461b5a7fb Sync with mplayer's stuff
nickols_k
parents: 5
diff changeset
54 //static const unsigned short mm_wone[4] __attribute__ ((aligned(8))) = { 0x1, 0x1, 0x1, 0x1 };
1b4461b5a7fb Sync with mplayer's stuff
nickols_k
parents: 5
diff changeset
55 //static const unsigned short mm_wtwo[4] __attribute__ ((aligned(8))) = { 0x2, 0x2, 0x2, 0x2 };
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
56
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
57 #define JUMPALIGN() __asm __volatile (".balign 8"::)
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
58 #define MOVQ_ZERO(regd) __asm __volatile ("pxor %%" #regd ", %%" #regd ::)
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
59
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
60 #ifndef PIC
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
61 #define MOVQ_WONE(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_wone))
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
62 #define MOVQ_WTWO(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_wtwo))
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
63 #else
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
64 // for shared library it's better to use this way for accessing constants
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
65 // pcmpeqd -> -1
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
66 #define MOVQ_WONE(regd) \
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
67 __asm __volatile ( \
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
68 "pcmpeqd %%" #regd ", %%" #regd " \n\t" \
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
69 "psrlw $15, %%" #regd ::)
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
70
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
71 #define MOVQ_WTWO(regd) \
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
72 __asm __volatile ( \
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
73 "pcmpeqd %%" #regd ", %%" #regd " \n\t" \
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
74 "psrlw $15, %%" #regd " \n\t" \
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
75 "psllw $1, %%" #regd ::)
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
76 #endif
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
77
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
78 /***********************************/
986e461dc072 Initial revision
glantau
parents:
diff changeset
79 /* 3Dnow specific */
986e461dc072 Initial revision
glantau
parents:
diff changeset
80
986e461dc072 Initial revision
glantau
parents:
diff changeset
81 #define DEF(x) x ## _3dnow
986e461dc072 Initial revision
glantau
parents:
diff changeset
82 /* for Athlons PAVGUSB is prefered */
986e461dc072 Initial revision
glantau
parents:
diff changeset
83 #define PAVGB "pavgusb"
986e461dc072 Initial revision
glantau
parents:
diff changeset
84
986e461dc072 Initial revision
glantau
parents:
diff changeset
85 #include "dsputil_mmx_avg.h"
986e461dc072 Initial revision
glantau
parents:
diff changeset
86
986e461dc072 Initial revision
glantau
parents:
diff changeset
87 #undef DEF
986e461dc072 Initial revision
glantau
parents:
diff changeset
88 #undef PAVGB
986e461dc072 Initial revision
glantau
parents:
diff changeset
89
986e461dc072 Initial revision
glantau
parents:
diff changeset
90 /***********************************/
986e461dc072 Initial revision
glantau
parents:
diff changeset
91 /* MMX2 specific */
986e461dc072 Initial revision
glantau
parents:
diff changeset
92
986e461dc072 Initial revision
glantau
parents:
diff changeset
93 #define DEF(x) x ## _sse
986e461dc072 Initial revision
glantau
parents:
diff changeset
94
986e461dc072 Initial revision
glantau
parents:
diff changeset
95 /* Introduced only in MMX2 set */
986e461dc072 Initial revision
glantau
parents:
diff changeset
96 #define PAVGB "pavgb"
986e461dc072 Initial revision
glantau
parents:
diff changeset
97
986e461dc072 Initial revision
glantau
parents:
diff changeset
98 #include "dsputil_mmx_avg.h"
986e461dc072 Initial revision
glantau
parents:
diff changeset
99
986e461dc072 Initial revision
glantau
parents:
diff changeset
100 #undef DEF
986e461dc072 Initial revision
glantau
parents:
diff changeset
101 #undef PAVGB
986e461dc072 Initial revision
glantau
parents:
diff changeset
102
986e461dc072 Initial revision
glantau
parents:
diff changeset
103 /***********************************/
986e461dc072 Initial revision
glantau
parents:
diff changeset
104 /* standard MMX */
986e461dc072 Initial revision
glantau
parents:
diff changeset
105
986e461dc072 Initial revision
glantau
parents:
diff changeset
106 static void get_pixels_mmx(DCTELEM *block, const UINT8 *pixels, int line_size)
986e461dc072 Initial revision
glantau
parents:
diff changeset
107 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
108 DCTELEM *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
109 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
110 int i;
986e461dc072 Initial revision
glantau
parents:
diff changeset
111
986e461dc072 Initial revision
glantau
parents:
diff changeset
112 /* read the pixels */
986e461dc072 Initial revision
glantau
parents:
diff changeset
113 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
114 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
115 MOVQ_ZERO(mm7);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
116 for(i=0;i<4;i++) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
117 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
118 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
119 "movq %2, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
120 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
121 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
122 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
123 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
124 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
125 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
126 "movq %%mm0, %0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
127 "movq %%mm2, 8%0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
128 "movq %%mm1, 16%0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
129 "movq %%mm3, 24%0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
130 :"=m"(*p)
986e461dc072 Initial revision
glantau
parents:
diff changeset
131 :"m"(*pix), "m"(*(pix+line_size))
986e461dc072 Initial revision
glantau
parents:
diff changeset
132 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
133 pix += line_size*2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
134 p += 16;
986e461dc072 Initial revision
glantau
parents:
diff changeset
135 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
136 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
137
324
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
138 static void diff_pixels_mmx(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride)
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
139 {
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
140 asm volatile(
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
141 ".balign 16 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
142 "movl $-128, %%eax \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
143 "1: \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
144 "movq (%0), %%mm0 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
145 "movq (%1), %%mm2 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
146 "movq %%mm0, %%mm1 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
147 "movq %%mm2, %%mm3 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
148 "punpcklbw %%mm7, %%mm0 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
149 "punpckhbw %%mm7, %%mm1 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
150 "punpcklbw %%mm7, %%mm2 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
151 "punpckhbw %%mm7, %%mm3 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
152 "psubw %%mm2, %%mm0 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
153 "psubw %%mm3, %%mm1 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
154 "movq %%mm0, (%2, %%eax)\n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
155 "movq %%mm1, 8(%2, %%eax)\n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
156 "addl %3, %0 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
157 "addl %3, %1 \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
158 "addl $16, %%eax \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
159 "jnz 1b \n\t"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
160 : "+r" (s1), "+r" (s2)
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
161 : "r" (block+64), "r" (stride)
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
162 : "%eax"
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
163 );
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
164 }
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
165
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
166 static void put_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size)
986e461dc072 Initial revision
glantau
parents:
diff changeset
167 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
168 const DCTELEM *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
169 UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
170
986e461dc072 Initial revision
glantau
parents:
diff changeset
171 /* read the pixels */
986e461dc072 Initial revision
glantau
parents:
diff changeset
172 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
173 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
174 /* unrolled loop */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
175 __asm __volatile(
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
176 "movq %3, %%mm0\n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
177 "movq 8%3, %%mm1\n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
178 "movq 16%3, %%mm2\n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
179 "movq 24%3, %%mm3\n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
180 "movq 32%3, %%mm4\n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
181 "movq 40%3, %%mm5\n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
182 "movq 48%3, %%mm6\n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
183 "movq 56%3, %%mm7\n\t"
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
184 "packuswb %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
185 "packuswb %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
186 "packuswb %%mm5, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
187 "packuswb %%mm7, %%mm6\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
188 "movq %%mm0, (%0)\n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
189 "movq %%mm2, (%0, %1)\n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
190 "movq %%mm4, (%0, %1, 2)\n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
191 "movq %%mm6, (%0, %2)\n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
192 ::"r" (pix), "r" (line_size), "r" (line_size*3), "m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
193 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
194 pix += line_size*4;
986e461dc072 Initial revision
glantau
parents:
diff changeset
195 p += 32;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
196
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
197 // if here would be an exact copy of the code above
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
198 // compiler would generate some very strange code
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
199 // thus using "r"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
200 __asm __volatile(
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
201 "movq (%3), %%mm0\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
202 "movq 8(%3), %%mm1\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
203 "movq 16(%3), %%mm2\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
204 "movq 24(%3), %%mm3\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
205 "movq 32(%3), %%mm4\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
206 "movq 40(%3), %%mm5\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
207 "movq 48(%3), %%mm6\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
208 "movq 56(%3), %%mm7\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
209 "packuswb %%mm1, %%mm0\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
210 "packuswb %%mm3, %%mm2\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
211 "packuswb %%mm5, %%mm4\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
212 "packuswb %%mm7, %%mm6\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
213 "movq %%mm0, (%0)\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
214 "movq %%mm2, (%0, %1)\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
215 "movq %%mm4, (%0, %1, 2)\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
216 "movq %%mm6, (%0, %2)\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
217 ::"r" (pix), "r" (line_size), "r" (line_size*3), "r"(p)
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
218 :"memory");
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
219 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
220
986e461dc072 Initial revision
glantau
parents:
diff changeset
221 static void add_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size)
986e461dc072 Initial revision
glantau
parents:
diff changeset
222 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
223 const DCTELEM *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
224 UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
225 int i;
986e461dc072 Initial revision
glantau
parents:
diff changeset
226
986e461dc072 Initial revision
glantau
parents:
diff changeset
227 /* read the pixels */
986e461dc072 Initial revision
glantau
parents:
diff changeset
228 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
229 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
230 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
231 i = 4;
342
8635a7036395 * fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents: 324
diff changeset
232 do {
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
233 __asm __volatile(
342
8635a7036395 * fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents: 324
diff changeset
234 "movq (%2), %%mm0\n\t"
8635a7036395 * fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents: 324
diff changeset
235 "movq 8(%2), %%mm1\n\t"
8635a7036395 * fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents: 324
diff changeset
236 "movq 16(%2), %%mm2\n\t"
8635a7036395 * fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents: 324
diff changeset
237 "movq 24(%2), %%mm3\n\t"
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
238 "movq %0, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
239 "movq %1, %%mm6\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
240 "movq %%mm4, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
241 "punpcklbw %%mm7, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
242 "punpckhbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
243 "paddsw %%mm4, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
244 "paddsw %%mm5, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
245 "movq %%mm6, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
246 "punpcklbw %%mm7, %%mm6\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
247 "punpckhbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
248 "paddsw %%mm6, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
249 "paddsw %%mm5, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
250 "packuswb %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
251 "packuswb %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
252 "movq %%mm0, %0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
253 "movq %%mm2, %1\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
254 :"+m"(*pix), "+m"(*(pix+line_size))
342
8635a7036395 * fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents: 324
diff changeset
255 :"r"(p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
256 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
257 pix += line_size*2;
986e461dc072 Initial revision
glantau
parents:
diff changeset
258 p += 16;
342
8635a7036395 * fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents: 324
diff changeset
259 } while (--i);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
260 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
261
986e461dc072 Initial revision
glantau
parents:
diff changeset
262 static void put_pixels_mmx(UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
263 {
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
264 int hh;
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
265 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
266 const UINT8 *pix;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
267
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
268 p = block;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
269 pix = pixels; // 2s
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
270 #if 0
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
271 do {
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
272 __asm __volatile(
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
273 "movq %1, %%mm0\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
274 "movq %%mm0, %0\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
275 :"=m"(*p)
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
276 :"m"(*pix)
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
277 :"memory");
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
278 pix += line_size;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
279 p += line_size;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
280 } while (--h);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
281 #else
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
282 // this optimized code is not very usefull
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
283 // the above loop is definitely faster
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
284 // at least on Celeron 500MHz
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
285 hh = h & 3;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
286 while (hh) {
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
287 __asm __volatile(
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
288 "movq %1, %%mm0\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
289 "movq %%mm0, %0\n\t"
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
290 :"=m"(*p)
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
291 :"m"(*pix)
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
292 :"memory");
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
293 pix += line_size;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
294 p += line_size;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
295 hh--;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
296 }
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
297 hh=h>>2;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
298 while (hh) {
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
299 __asm __volatile(
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
300 "movq (%1), %%mm0 \n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
301 "movq (%1, %2), %%mm1 \n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
302 "movq (%1, %2, 2), %%mm2 \n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
303 "movq (%1, %3), %%mm3 \n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
304 "movq %%mm0, (%0) \n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
305 "movq %%mm1, (%0, %2) \n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
306 "movq %%mm2, (%0, %2, 2) \n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
307 "movq %%mm3, (%0, %3) \n\t"
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
308 ::"r"(p), "r"(pix), "r"(line_size), "r"(line_size*3)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
309 :"memory");
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
310 pix += line_size*4;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
311 p += line_size*4;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
312 hh--;
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
313 }
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
314 #endif
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
315 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
316
986e461dc072 Initial revision
glantau
parents:
diff changeset
317 static void put_pixels_x2_mmx(UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
318 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
319 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
320 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
321 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
322 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
323 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
324 MOVQ_WONE(mm4);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
325 JUMPALIGN();
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
326 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
327 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
328 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
329 "movq 1%1, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
330 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
331 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
332 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
333 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
334 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
335 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
336 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
337 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
338 "paddusw %%mm4, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
339 "paddusw %%mm4, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
340 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
341 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
342 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
343 "movq %%mm0, %0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
344 :"=m"(*p)
986e461dc072 Initial revision
glantau
parents:
diff changeset
345 :"m"(*pix)
986e461dc072 Initial revision
glantau
parents:
diff changeset
346 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
347 pix += line_size; p += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
348 } while (--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
349 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
350
986e461dc072 Initial revision
glantau
parents:
diff changeset
351 static void put_pixels_y2_mmx(UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
352 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
353 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
354 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
355 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
356 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
357 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
358 MOVQ_WONE(mm4);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
359 JUMPALIGN();
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
360 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
361 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
362 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
363 "movq %2, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
364 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
365 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
366 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
367 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
368 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
369 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
370 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
371 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
372 "paddusw %%mm4, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
373 "paddusw %%mm4, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
374 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
375 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
376 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
377 "movq %%mm0, %0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
378 :"=m"(*p)
986e461dc072 Initial revision
glantau
parents:
diff changeset
379 :"m"(*pix),
986e461dc072 Initial revision
glantau
parents:
diff changeset
380 "m"(*(pix+line_size))
986e461dc072 Initial revision
glantau
parents:
diff changeset
381 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
382 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
383 p += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
384 } while (--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
385 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
386
986e461dc072 Initial revision
glantau
parents:
diff changeset
387 static void put_pixels_xy2_mmx(UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
388 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
389 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
390 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
391 p = block;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
392 pix = pixels; // 1s
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
393 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
394 MOVQ_WTWO(mm6);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
395 JUMPALIGN();
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
396 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
397 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
398 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
399 "movq %2, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
400 "movq 1%1, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
401 "movq 1%2, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
402 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
403 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
404 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
405 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
406 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
407 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
408 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
409 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
410 "movq %%mm4, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
411 "movq %%mm5, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
412 "punpcklbw %%mm7, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
413 "punpcklbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
414 "punpckhbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
415 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
416 "paddusw %%mm5, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
417 "paddusw %%mm3, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
418 "paddusw %%mm6, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
419 "paddusw %%mm6, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
420 "paddusw %%mm4, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
421 "paddusw %%mm1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
422 "psrlw $2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
423 "psrlw $2, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
424 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
425 "movq %%mm0, %0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
426 :"=m"(*p)
986e461dc072 Initial revision
glantau
parents:
diff changeset
427 :"m"(*pix),
986e461dc072 Initial revision
glantau
parents:
diff changeset
428 "m"(*(pix+line_size))
986e461dc072 Initial revision
glantau
parents:
diff changeset
429 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
430 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
431 p += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
432 } while(--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
433 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
434
986e461dc072 Initial revision
glantau
parents:
diff changeset
435 static void put_no_rnd_pixels_x2_mmx( UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
436 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
437 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
438 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
439 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
440 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
441 MOVQ_ZERO(mm7);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
442 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
443 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
444 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
445 "movq 1%1, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
446 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
447 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
448 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
449 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
450 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
451 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
452 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
453 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
454 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
455 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
456 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
457 "movq %%mm0, %0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
458 :"=m"(*p)
986e461dc072 Initial revision
glantau
parents:
diff changeset
459 :"m"(*pix)
986e461dc072 Initial revision
glantau
parents:
diff changeset
460 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
461 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
462 p += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
463 } while (--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
464 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
465
986e461dc072 Initial revision
glantau
parents:
diff changeset
466 static void put_no_rnd_pixels_y2_mmx( UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
467 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
468 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
469 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
470 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
471 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
472 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
473 JUMPALIGN();
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
474 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
475 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
476 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
477 "movq %2, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
478 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
479 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
480 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
481 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
482 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
483 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
484 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
485 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
486 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
487 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
488 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
489 "movq %%mm0, %0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
490 :"=m"(*p)
986e461dc072 Initial revision
glantau
parents:
diff changeset
491 :"m"(*pix),
986e461dc072 Initial revision
glantau
parents:
diff changeset
492 "m"(*(pix+line_size))
986e461dc072 Initial revision
glantau
parents:
diff changeset
493 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
494 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
495 p += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
496 } while(--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
497 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
498
986e461dc072 Initial revision
glantau
parents:
diff changeset
499 static void put_no_rnd_pixels_xy2_mmx( UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
500 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
501 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
502 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
503 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
504 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
505 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
506 MOVQ_WONE(mm6);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
507 JUMPALIGN();
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
508 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
509 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
510 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
511 "movq %2, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
512 "movq 1%1, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
513 "movq 1%2, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
514 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
515 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
516 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
517 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
518 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
519 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
520 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
521 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
522 "movq %%mm4, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
523 "movq %%mm5, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
524 "punpcklbw %%mm7, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
525 "punpcklbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
526 "punpckhbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
527 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
528 "paddusw %%mm5, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
529 "paddusw %%mm3, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
530 "paddusw %%mm6, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
531 "paddusw %%mm6, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
532 "paddusw %%mm4, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
533 "paddusw %%mm1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
534 "psrlw $2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
535 "psrlw $2, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
536 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
537 "movq %%mm0, %0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
538 :"=m"(*p)
986e461dc072 Initial revision
glantau
parents:
diff changeset
539 :"m"(*pix),
986e461dc072 Initial revision
glantau
parents:
diff changeset
540 "m"(*(pix+line_size))
986e461dc072 Initial revision
glantau
parents:
diff changeset
541 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
542 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
543 p += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
544 } while(--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
545 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
546
986e461dc072 Initial revision
glantau
parents:
diff changeset
547 static void avg_pixels_mmx(UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
548 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
549 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
550 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
551 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
552 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
553 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
554 MOVQ_WONE(mm6);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
555 JUMPALIGN();
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
556 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
557 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
558 "movq %0, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
559 "movq %1, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
560 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
561 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
562 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
563 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
564 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
565 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
566 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
567 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
568 "paddusw %%mm6, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
569 "paddusw %%mm6, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
570 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
571 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
572 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
573 "movq %%mm0, %0\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
574 :"+m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
575 :"m"(*pix)
986e461dc072 Initial revision
glantau
parents:
diff changeset
576 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
577 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
578 p += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
579 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
580 while (--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
581 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
582
986e461dc072 Initial revision
glantau
parents:
diff changeset
583 static void avg_pixels_x2_mmx( UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
584 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
585 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
586 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
587 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
588 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
589 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
590 MOVQ_WONE(mm6);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
591 JUMPALIGN();
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
592 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
593 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
594 "movq %1, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
595 "movq %0, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
596 "movq 1%1, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
597 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
598 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
599 "movq %%mm4, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
600 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
601 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
602 "punpcklbw %%mm7, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
603 "punpckhbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
604 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
605 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
606 "paddusw %%mm4, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
607 "paddusw %%mm5, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
608 "paddusw %%mm6, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
609 "paddusw %%mm6, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
610 "psrlw $1, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
611 "psrlw $1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
612 "paddusw %%mm6, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
613 "paddusw %%mm6, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
614 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
615 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
616 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
617 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
618 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
619 "movq %%mm0, %0\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
620 :"+m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
621 :"m"(*pix)
986e461dc072 Initial revision
glantau
parents:
diff changeset
622 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
623 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
624 p += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
625 } while (--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
626 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
627
986e461dc072 Initial revision
glantau
parents:
diff changeset
628 static void avg_pixels_y2_mmx( UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
629 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
630 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
631 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
632 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
633 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
634 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
635 MOVQ_WONE(mm6);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
636 JUMPALIGN();
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
637 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
638 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
639 "movq %1, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
640 "movq %0, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
641 "movq %2, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
642 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
643 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
644 "movq %%mm4, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
645 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
646 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
647 "punpcklbw %%mm7, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
648 "punpckhbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
649 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
650 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
651 "paddusw %%mm4, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
652 "paddusw %%mm5, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
653 "paddusw %%mm6, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
654 "paddusw %%mm6, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
655 "psrlw $1, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
656 "psrlw $1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
657 "paddusw %%mm6, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
658 "paddusw %%mm6, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
659 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
660 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
661 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
662 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
663 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
664 "movq %%mm0, %0\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
665 :"+m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
666 :"m"(*pix), "m"(*(pix+line_size))
986e461dc072 Initial revision
glantau
parents:
diff changeset
667 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
668 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
669 p += line_size ;
986e461dc072 Initial revision
glantau
parents:
diff changeset
670 } while(--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
671 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
672
986e461dc072 Initial revision
glantau
parents:
diff changeset
673 static void avg_pixels_xy2_mmx( UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
674 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
675 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
676 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
677 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
678 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
679 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
680 // this doesn't seem to be used offten - so
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
681 // the inside usage of mm_wone is not optimized
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
682 MOVQ_WTWO(mm6);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
683 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
684 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
685 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
686 "movq %2, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
687 "movq 1%1, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
688 "movq 1%2, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
689 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
690 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
691 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
692 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
693 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
694 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
695 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
696 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
697 "movq %%mm4, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
698 "movq %%mm5, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
699 "punpcklbw %%mm7, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
700 "punpcklbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
701 "punpckhbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
702 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
703 "paddusw %%mm5, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
704 "paddusw %%mm3, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
705 "paddusw %%mm6, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
706 "paddusw %%mm6, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
707 "paddusw %%mm4, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
708 "paddusw %%mm1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
709 "movq %3, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
710 "psrlw $2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
711 "movq %0, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
712 "psrlw $2, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
713 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
714 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
715 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
716 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
717 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
718 "paddusw %%mm5, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
719 "paddusw %%mm5, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
720 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
721 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
722 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
723 "movq %%mm0, %0\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
724 :"+m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
725 :"m"(*pix),
8
1b4461b5a7fb Sync with mplayer's stuff
nickols_k
parents: 5
diff changeset
726 "m"(*(pix+line_size)), "m"(mm_wone)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
727 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
728 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
729 p += line_size ;
986e461dc072 Initial revision
glantau
parents:
diff changeset
730 } while(--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
731 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
732
986e461dc072 Initial revision
glantau
parents:
diff changeset
733 static void avg_no_rnd_pixels_mmx( UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
734 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
735 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
736 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
737 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
738 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
739 MOVQ_ZERO(mm7);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
740 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
741 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
742 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
743 "movq %0, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
744 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
745 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
746 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
747 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
748 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
749 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
750 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
751 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
752 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
753 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
754 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
755 "movq %%mm0, %0\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
756 :"+m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
757 :"m"(*pix)
986e461dc072 Initial revision
glantau
parents:
diff changeset
758 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
759 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
760 p += line_size ;
986e461dc072 Initial revision
glantau
parents:
diff changeset
761 } while (--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
762 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
763
986e461dc072 Initial revision
glantau
parents:
diff changeset
764 static void avg_no_rnd_pixels_x2_mmx( UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
765 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
766 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
767 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
768 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
769 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
770 MOVQ_ZERO(mm7);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
771 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
772 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
773 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
774 "movq 1%1, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
775 "movq %0, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
776 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
777 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
778 "movq %%mm4, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
779 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
780 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
781 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
782 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
783 "punpcklbw %%mm7, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
784 "punpckhbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
785 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
786 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
787 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
788 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
789 "paddusw %%mm4, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
790 "paddusw %%mm5, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
791 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
792 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
793 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
794 "movq %%mm0, %0\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
795 :"+m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
796 :"m"(*pix)
986e461dc072 Initial revision
glantau
parents:
diff changeset
797 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
798 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
799 p += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
800 } while (--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
801 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
802
986e461dc072 Initial revision
glantau
parents:
diff changeset
803 static void avg_no_rnd_pixels_y2_mmx( UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
804 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
805 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
806 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
807 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
808 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
809 MOVQ_ZERO(mm7);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
810 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
811 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
812 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
813 "movq %2, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
814 "movq %0, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
815 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
816 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
817 "movq %%mm4, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
818 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
819 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
820 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
821 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
822 "punpcklbw %%mm7, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
823 "punpckhbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
824 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
825 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
826 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
827 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
828 "paddusw %%mm4, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
829 "paddusw %%mm5, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
830 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
831 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
832 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
833 "movq %%mm0, %0\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
834 :"+m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
835 :"m"(*pix), "m"(*(pix+line_size))
986e461dc072 Initial revision
glantau
parents:
diff changeset
836 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
837 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
838 p += line_size ;
986e461dc072 Initial revision
glantau
parents:
diff changeset
839 } while(--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
840 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
841
986e461dc072 Initial revision
glantau
parents:
diff changeset
842 static void avg_no_rnd_pixels_xy2_mmx( UINT8 *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
843 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
844 UINT8 *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
845 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
846 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
847 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
848 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
849 MOVQ_WONE(mm6);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
850 JUMPALIGN();
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
851 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
852 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
853 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
854 "movq %2, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
855 "movq 1%1, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
856 "movq 1%2, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
857 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
858 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
859 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
860 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
861 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
862 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
863 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
864 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
865 "movq %%mm4, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
866 "movq %%mm5, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
867 "punpcklbw %%mm7, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
868 "punpcklbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
869 "punpckhbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
870 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
871 "paddusw %%mm5, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
872 "paddusw %%mm3, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
873 "paddusw %%mm6, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
874 "paddusw %%mm6, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
875 "paddusw %%mm4, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
876 "paddusw %%mm1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
877 "movq %0, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
878 "psrlw $2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
879 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
880 "psrlw $2, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
881 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
882 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
883 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
884 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
885 "psrlw $1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
886 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
887 "packuswb %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
888 "movq %%mm0, %0\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
889 :"+m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
890 :"m"(*pix),
986e461dc072 Initial revision
glantau
parents:
diff changeset
891 "m"(*(pix+line_size))
986e461dc072 Initial revision
glantau
parents:
diff changeset
892 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
893 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
894 p += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
895 } while(--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
896 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
897
986e461dc072 Initial revision
glantau
parents:
diff changeset
898 static void sub_pixels_mmx( DCTELEM *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
899 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
900 DCTELEM *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
901 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
902 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
903 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
904 MOVQ_ZERO(mm7);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
905 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
906 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
907 "movq %0, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
908 "movq %1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
909 "movq 8%0, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
910 "movq %%mm2, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
911 "punpcklbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
912 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
913 "psubsw %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
914 "psubsw %%mm3, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
915 "movq %%mm0, %0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
916 "movq %%mm1, 8%0\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
917 :"+m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
918 :"m"(*pix)
986e461dc072 Initial revision
glantau
parents:
diff changeset
919 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
920 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
921 p += 8;
986e461dc072 Initial revision
glantau
parents:
diff changeset
922 } while (--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
923 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
924
986e461dc072 Initial revision
glantau
parents:
diff changeset
925 static void sub_pixels_x2_mmx( DCTELEM *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
926 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
927 DCTELEM *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
928 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
929 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
930 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
931 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
932 MOVQ_WONE(mm6);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
933 JUMPALIGN();
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
934 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
935 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
936 "movq %0, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
937 "movq %1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
938 "movq 8%0, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
939 "movq 1%1, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
940 "movq %%mm2, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
941 "movq %%mm4, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
942 "punpcklbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
943 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
944 "punpcklbw %%mm7, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
945 "punpckhbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
946 "paddusw %%mm4, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
947 "paddusw %%mm5, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
948 "paddusw %%mm6, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
949 "paddusw %%mm6, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
950 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
951 "psrlw $1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
952 "psubsw %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
953 "psubsw %%mm3, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
954 "movq %%mm0, %0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
955 "movq %%mm1, 8%0\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
956 :"+m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
957 :"m"(*pix)
986e461dc072 Initial revision
glantau
parents:
diff changeset
958 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
959 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
960 p += 8;
986e461dc072 Initial revision
glantau
parents:
diff changeset
961 } while (--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
962 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
963
986e461dc072 Initial revision
glantau
parents:
diff changeset
964 static void sub_pixels_y2_mmx( DCTELEM *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
965 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
966 DCTELEM *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
967 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
968 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
969 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
970 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
971 MOVQ_WONE(mm6);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
972 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
973 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
974 "movq %0, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
975 "movq %1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
976 "movq 8%0, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
977 "movq %2, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
978 "movq %%mm2, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
979 "movq %%mm4, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
980 "punpcklbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
981 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
982 "punpcklbw %%mm7, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
983 "punpckhbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
984 "paddusw %%mm4, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
985 "paddusw %%mm5, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
986 "paddusw %%mm6, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
987 "paddusw %%mm6, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
988 "psrlw $1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
989 "psrlw $1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
990 "psubsw %%mm2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
991 "psubsw %%mm3, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
992 "movq %%mm0, %0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
993 "movq %%mm1, 8%0\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
994 :"+m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
995 :"m"(*pix), "m"(*(pix+line_size))
986e461dc072 Initial revision
glantau
parents:
diff changeset
996 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
997 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
998 p += 8;
986e461dc072 Initial revision
glantau
parents:
diff changeset
999 } while (--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1000 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1001
986e461dc072 Initial revision
glantau
parents:
diff changeset
1002 static void sub_pixels_xy2_mmx( DCTELEM *block, const UINT8 *pixels, int line_size, int h)
986e461dc072 Initial revision
glantau
parents:
diff changeset
1003 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1004 DCTELEM *p;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1005 const UINT8 *pix;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1006 p = block;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1007 pix = pixels;
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1008 MOVQ_ZERO(mm7);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1009 MOVQ_WTWO(mm6);
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1010 JUMPALIGN();
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1011 do {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1012 __asm __volatile(
986e461dc072 Initial revision
glantau
parents:
diff changeset
1013 "movq %1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1014 "movq %2, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1015 "movq 1%1, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1016 "movq 1%2, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1017 "movq %%mm0, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1018 "movq %%mm1, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1019 "punpcklbw %%mm7, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1020 "punpcklbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1021 "punpckhbw %%mm7, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1022 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1023 "paddusw %%mm1, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1024 "paddusw %%mm3, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1025 "movq %%mm4, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1026 "movq %%mm5, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1027 "punpcklbw %%mm7, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1028 "punpcklbw %%mm7, %%mm5\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1029 "punpckhbw %%mm7, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1030 "punpckhbw %%mm7, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1031 "paddusw %%mm5, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1032 "paddusw %%mm3, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1033 "paddusw %%mm6, %%mm4\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1034 "paddusw %%mm6, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1035 "paddusw %%mm4, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1036 "paddusw %%mm1, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1037 "movq %0, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1038 "movq 8%0, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1039 "psrlw $2, %%mm0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1040 "psrlw $2, %%mm2\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1041 "psubsw %%mm0, %%mm1\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1042 "psubsw %%mm2, %%mm3\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1043 "movq %%mm1, %0\n\t"
986e461dc072 Initial revision
glantau
parents:
diff changeset
1044 "movq %%mm3, 8%0\n\t"
151
ae0516eadae2 fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents: 42
diff changeset
1045 :"+m"(*p)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1046 :"m"(*pix),
986e461dc072 Initial revision
glantau
parents:
diff changeset
1047 "m"(*(pix+line_size))
986e461dc072 Initial revision
glantau
parents:
diff changeset
1048 :"memory");
986e461dc072 Initial revision
glantau
parents:
diff changeset
1049 pix += line_size;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1050 p += 8 ;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1051 } while(--h);
986e461dc072 Initial revision
glantau
parents:
diff changeset
1052 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
1053
296
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1054 static void clear_blocks_mmx(DCTELEM *blocks)
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1055 {
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1056 asm volatile(
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1057 "pxor %%mm7, %%mm7 \n\t"
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1058 "movl $-128*6, %%eax \n\t"
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1059 "1: \n\t"
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1060 "movq %%mm7, (%0, %%eax) \n\t"
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1061 "movq %%mm7, 8(%0, %%eax) \n\t"
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1062 "movq %%mm7, 16(%0, %%eax) \n\t"
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1063 "movq %%mm7, 24(%0, %%eax) \n\t"
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1064 "addl $32, %%eax \n\t"
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1065 " js 1b \n\t"
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1066 : : "r" (((int)blocks)+128*6)
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1067 : "%eax"
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1068 );
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1069 }
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1070
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1071 static void just_return() { return; }
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1072
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1073 void dsputil_init_mmx(void)
986e461dc072 Initial revision
glantau
parents:
diff changeset
1074 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1075 mm_flags = mm_support();
188
5d56c2f7e712 print cpu flags
uid46427
parents: 174
diff changeset
1076 #if 1
5d56c2f7e712 print cpu flags
uid46427
parents: 174
diff changeset
1077 printf("libavcodec: CPU flags:");
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1078 if (mm_flags & MM_MMX)
986e461dc072 Initial revision
glantau
parents:
diff changeset
1079 printf(" mmx");
986e461dc072 Initial revision
glantau
parents:
diff changeset
1080 if (mm_flags & MM_MMXEXT)
986e461dc072 Initial revision
glantau
parents:
diff changeset
1081 printf(" mmxext");
986e461dc072 Initial revision
glantau
parents:
diff changeset
1082 if (mm_flags & MM_3DNOW)
986e461dc072 Initial revision
glantau
parents:
diff changeset
1083 printf(" 3dnow");
986e461dc072 Initial revision
glantau
parents:
diff changeset
1084 if (mm_flags & MM_SSE)
986e461dc072 Initial revision
glantau
parents:
diff changeset
1085 printf(" sse");
986e461dc072 Initial revision
glantau
parents:
diff changeset
1086 if (mm_flags & MM_SSE2)
986e461dc072 Initial revision
glantau
parents:
diff changeset
1087 printf(" sse2");
986e461dc072 Initial revision
glantau
parents:
diff changeset
1088 printf("\n");
986e461dc072 Initial revision
glantau
parents:
diff changeset
1089 #endif
986e461dc072 Initial revision
glantau
parents:
diff changeset
1090
986e461dc072 Initial revision
glantau
parents:
diff changeset
1091 if (mm_flags & MM_MMX) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1092 get_pixels = get_pixels_mmx;
324
9c6f056f0e41 fixed mpeg4 time stuff on encoding
michaelni
parents: 296
diff changeset
1093 diff_pixels = diff_pixels_mmx;
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1094 put_pixels_clamped = put_pixels_clamped_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1095 add_pixels_clamped = add_pixels_clamped_mmx;
296
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1096 clear_blocks= clear_blocks_mmx;
c1a8a1b4a24b sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni
parents: 294
diff changeset
1097
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1098 pix_abs16x16 = pix_abs16x16_mmx;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1099 pix_abs16x16_x2 = pix_abs16x16_x2_mmx;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1100 pix_abs16x16_y2 = pix_abs16x16_y2_mmx;
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1101 pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx;
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1102 pix_abs8x8 = pix_abs8x8_mmx;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1103 pix_abs8x8_x2 = pix_abs8x8_x2_mmx;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1104 pix_abs8x8_y2 = pix_abs8x8_y2_mmx;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1105 pix_abs8x8_xy2= pix_abs8x8_xy2_mmx;
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1106 av_fdct = fdct_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1107
986e461dc072 Initial revision
glantau
parents:
diff changeset
1108 put_pixels_tab[0] = put_pixels_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1109 put_pixels_tab[1] = put_pixels_x2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1110 put_pixels_tab[2] = put_pixels_y2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1111 put_pixels_tab[3] = put_pixels_xy2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1112
986e461dc072 Initial revision
glantau
parents:
diff changeset
1113 put_no_rnd_pixels_tab[0] = put_pixels_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1114 put_no_rnd_pixels_tab[1] = put_no_rnd_pixels_x2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1115 put_no_rnd_pixels_tab[2] = put_no_rnd_pixels_y2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1116 put_no_rnd_pixels_tab[3] = put_no_rnd_pixels_xy2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1117
986e461dc072 Initial revision
glantau
parents:
diff changeset
1118 avg_pixels_tab[0] = avg_pixels_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1119 avg_pixels_tab[1] = avg_pixels_x2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1120 avg_pixels_tab[2] = avg_pixels_y2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1121 avg_pixels_tab[3] = avg_pixels_xy2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1122
986e461dc072 Initial revision
glantau
parents:
diff changeset
1123 avg_no_rnd_pixels_tab[0] = avg_no_rnd_pixels_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1124 avg_no_rnd_pixels_tab[1] = avg_no_rnd_pixels_x2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1125 avg_no_rnd_pixels_tab[2] = avg_no_rnd_pixels_y2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1126 avg_no_rnd_pixels_tab[3] = avg_no_rnd_pixels_xy2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1127
986e461dc072 Initial revision
glantau
parents:
diff changeset
1128 sub_pixels_tab[0] = sub_pixels_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1129 sub_pixels_tab[1] = sub_pixels_x2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1130 sub_pixels_tab[2] = sub_pixels_y2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1131 sub_pixels_tab[3] = sub_pixels_xy2_mmx;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1132
986e461dc072 Initial revision
glantau
parents:
diff changeset
1133 if (mm_flags & MM_MMXEXT) {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1134 pix_abs16x16 = pix_abs16x16_mmx2;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1135 pix_abs16x16_x2 = pix_abs16x16_x2_mmx2;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1136 pix_abs16x16_y2 = pix_abs16x16_y2_mmx2;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1137 pix_abs16x16_xy2= pix_abs16x16_xy2_mmx2;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1138
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1139 pix_abs8x8 = pix_abs8x8_mmx2;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1140 pix_abs8x8_x2 = pix_abs8x8_x2_mmx2;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1141 pix_abs8x8_y2 = pix_abs8x8_y2_mmx2;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1142 pix_abs8x8_xy2= pix_abs8x8_xy2_mmx2;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 247
diff changeset
1143
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1144 put_pixels_tab[1] = put_pixels_x2_sse;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1145 put_pixels_tab[2] = put_pixels_y2_sse;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1146
986e461dc072 Initial revision
glantau
parents:
diff changeset
1147 avg_pixels_tab[0] = avg_pixels_sse;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1148 avg_pixels_tab[1] = avg_pixels_x2_sse;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1149 avg_pixels_tab[2] = avg_pixels_y2_sse;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1150 avg_pixels_tab[3] = avg_pixels_xy2_sse;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1151
986e461dc072 Initial revision
glantau
parents:
diff changeset
1152 sub_pixels_tab[1] = sub_pixels_x2_sse;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1153 sub_pixels_tab[2] = sub_pixels_y2_sse;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1154 } else if (mm_flags & MM_3DNOW) {
986e461dc072 Initial revision
glantau
parents:
diff changeset
1155 put_pixels_tab[1] = put_pixels_x2_3dnow;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1156 put_pixels_tab[2] = put_pixels_y2_3dnow;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1157
986e461dc072 Initial revision
glantau
parents:
diff changeset
1158 avg_pixels_tab[0] = avg_pixels_3dnow;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1159 avg_pixels_tab[1] = avg_pixels_x2_3dnow;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1160 avg_pixels_tab[2] = avg_pixels_y2_3dnow;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1161 avg_pixels_tab[3] = avg_pixels_xy2_3dnow;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1162
986e461dc072 Initial revision
glantau
parents:
diff changeset
1163 sub_pixels_tab[1] = sub_pixels_x2_3dnow;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1164 sub_pixels_tab[2] = sub_pixels_y2_3dnow;
986e461dc072 Initial revision
glantau
parents:
diff changeset
1165 }
19
82d4c9be9873 MMX/MMXEXT iDCT support, using external functions currently defined in libmpeg2
arpi_esp
parents: 8
diff changeset
1166
42
8068c4bce9c1 added mmx idct
glantau
parents: 19
diff changeset
1167 /* idct */
8068c4bce9c1 added mmx idct
glantau
parents: 19
diff changeset
1168 if (mm_flags & MM_MMXEXT) {
8068c4bce9c1 added mmx idct
glantau
parents: 19
diff changeset
1169 ff_idct = ff_mmxext_idct;
8068c4bce9c1 added mmx idct
glantau
parents: 19
diff changeset
1170 } else {
8068c4bce9c1 added mmx idct
glantau
parents: 19
diff changeset
1171 ff_idct = ff_mmx_idct;
8068c4bce9c1 added mmx idct
glantau
parents: 19
diff changeset
1172 }
174
ac5075a55488 new IDCT code by Michael Niedermayer (michaelni@gmx.at) - #define SIMPLE_IDCT to enable
arpi_esp
parents: 151
diff changeset
1173 #ifdef SIMPLE_IDCT
ac5075a55488 new IDCT code by Michael Niedermayer (michaelni@gmx.at) - #define SIMPLE_IDCT to enable
arpi_esp
parents: 151
diff changeset
1174 // ff_idct = simple_idct;
ac5075a55488 new IDCT code by Michael Niedermayer (michaelni@gmx.at) - #define SIMPLE_IDCT to enable
arpi_esp
parents: 151
diff changeset
1175 ff_idct = simple_idct_mmx;
ac5075a55488 new IDCT code by Michael Niedermayer (michaelni@gmx.at) - #define SIMPLE_IDCT to enable
arpi_esp
parents: 151
diff changeset
1176 #endif
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1177 }
247
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1178
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1179 #if 0
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1180 // for speed testing
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1181 get_pixels = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1182 put_pixels_clamped = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1183 add_pixels_clamped = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1184
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1185 pix_abs16x16 = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1186 pix_abs16x16_x2 = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1187 pix_abs16x16_y2 = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1188 pix_abs16x16_xy2 = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1189
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1190 put_pixels_tab[0] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1191 put_pixels_tab[1] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1192 put_pixels_tab[2] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1193 put_pixels_tab[3] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1194
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1195 put_no_rnd_pixels_tab[0] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1196 put_no_rnd_pixels_tab[1] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1197 put_no_rnd_pixels_tab[2] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1198 put_no_rnd_pixels_tab[3] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1199
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1200 avg_pixels_tab[0] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1201 avg_pixels_tab[1] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1202 avg_pixels_tab[2] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1203 avg_pixels_tab[3] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1204
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1205 avg_no_rnd_pixels_tab[0] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1206 avg_no_rnd_pixels_tab[1] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1207 avg_no_rnd_pixels_tab[2] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1208 avg_no_rnd_pixels_tab[3] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1209
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1210 sub_pixels_tab[0] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1211 sub_pixels_tab[1] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1212 sub_pixels_tab[2] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1213 sub_pixels_tab[3] = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1214
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1215 //av_fdct = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1216 //ff_idct = just_return;
6f48cacd9ed9 * some modifications to allow gcc to compile same code for -fPIC
kabi
parents: 188
diff changeset
1217 #endif
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1218 }