annotate libmpeg2/motion_comp_mmx.c @ 31616:3da109629fca

Remove completely nonsensical le2me usages, the only effect they had was breaking playback on big-endian.
author reimar
date Sat, 10 Jul 2010 22:49:28 +0000
parents e41a2492e665
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 * motion_comp_mmx.c
10303
2c0b6ec77d39 sync with libmpeg2 cvs
alex
parents: 9852
diff changeset
3 * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
4 * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
7 * See http://libmpeg2.sourceforge.net/ for updates.
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 * mpeg2dec is free software; you can redistribute it and/or modify
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12 * (at your option) any later version.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 * mpeg2dec is distributed in the hope that it will be useful,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 * GNU General Public License for more details.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 #include "config.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 27572
diff changeset
26 #if ARCH_X86 || ARCH_X86_64
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 #include <inttypes.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
30 #include "mpeg2.h"
12932
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 10303
diff changeset
31 #include "attributes.h"
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 #include "mpeg2_internal.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 #include "mmx.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 #define CPU_MMXEXT 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 #define CPU_3DNOW 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38
30255
e41a2492e665 Avoid linking in assembler-optimized code that will never be used.
reimar
parents: 28290
diff changeset
39 #if HAVE_MMX
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
40 /* MMX code - needs a rewrite */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
42 /*
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
43 * Motion Compensation frequently needs to average values using the
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
44 * formula (x+y+1)>>1. Both MMXEXT and 3Dnow include one instruction
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
45 * to compute this, but it's been left out of classic MMX.
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
46 *
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
47 * We need to be careful of overflows when doing this computation.
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
48 * Rather than unpacking data to 16-bits, which reduces parallelism,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
49 * we use the following formulas:
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
50 *
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
51 * (x+y)>>1 == (x&y)+((x^y)>>1)
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
52 * (x+y+1)>>1 == (x|y)-((x^y)>>1)
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
53 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
55 /* some rounding constants */
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
56 static mmx_t mask1 = {0xfefefefefefefefeLL};
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
57 static mmx_t round4 = {0x0002000200020002LL};
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 * This code should probably be compiled with loop unrolling
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 * (ie, -funroll-loops in gcc)becuase some of the loops
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 * use a small static number of iterations. This was written
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 * with the assumption the compiler knows best about when
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 * unrolling will help
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66
27572
da2271c341ee Update internal libmpeg2 copy to version 0.5.1.
diego
parents: 27571
diff changeset
67 static inline void mmx_zero_reg (void)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 {
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
69 /* load 0 into mm0 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 pxor_r2r (mm0, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
73 static inline void mmx_average_2_U8 (uint8_t * dest, const uint8_t * src1,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
74 const uint8_t * src2)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 {
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
76 /* *dest = (*src1 + *src2 + 1)/ 2; */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
78 movq_m2r (*src1, mm1); /* load 8 src1 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
79 movq_r2r (mm1, mm2); /* copy 8 src1 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
81 movq_m2r (*src2, mm3); /* load 8 src2 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
82 movq_r2r (mm3, mm4); /* copy 8 src2 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
84 pxor_r2r (mm1, mm3); /* xor src1 and src2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
85 pand_m2r (mask1, mm3); /* mask lower bits */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
86 psrlq_i2r (1, mm3); /* /2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
87 por_r2r (mm2, mm4); /* or src1 and src2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
88 psubb_r2r (mm3, mm4); /* subtract subresults */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
89 movq_r2m (mm4, *dest); /* store result in dest */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 static inline void mmx_interp_average_2_U8 (uint8_t * dest,
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
93 const uint8_t * src1,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
94 const uint8_t * src2)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 {
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
96 /* *dest = (*dest + (*src1 + *src2 + 1)/ 2 + 1)/ 2; */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
98 movq_m2r (*dest, mm1); /* load 8 dest bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
99 movq_r2r (mm1, mm2); /* copy 8 dest bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
101 movq_m2r (*src1, mm3); /* load 8 src1 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
102 movq_r2r (mm3, mm4); /* copy 8 src1 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
104 movq_m2r (*src2, mm5); /* load 8 src2 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
105 movq_r2r (mm5, mm6); /* copy 8 src2 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
106
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
107 pxor_r2r (mm3, mm5); /* xor src1 and src2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
108 pand_m2r (mask1, mm5); /* mask lower bits */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
109 psrlq_i2r (1, mm5); /* /2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
110 por_r2r (mm4, mm6); /* or src1 and src2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
111 psubb_r2r (mm5, mm6); /* subtract subresults */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
112 movq_r2r (mm6, mm5); /* copy subresult */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
114 pxor_r2r (mm1, mm5); /* xor srcavg and dest */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
115 pand_m2r (mask1, mm5); /* mask lower bits */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
116 psrlq_i2r (1, mm5); /* /2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
117 por_r2r (mm2, mm6); /* or srcavg and dest */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
118 psubb_r2r (mm5, mm6); /* subtract subresults */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
119 movq_r2m (mm6, *dest); /* store result in dest */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
122 static inline void mmx_average_4_U8 (uint8_t * dest, const uint8_t * src1,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
123 const uint8_t * src2,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
124 const uint8_t * src3,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
125 const uint8_t * src4)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
126 {
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
127 /* *dest = (*src1 + *src2 + *src3 + *src4 + 2)/ 4; */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
128
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
129 movq_m2r (*src1, mm1); /* load 8 src1 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
130 movq_r2r (mm1, mm2); /* copy 8 src1 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
132 punpcklbw_r2r (mm0, mm1); /* unpack low src1 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
133 punpckhbw_r2r (mm0, mm2); /* unpack high src1 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
134
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
135 movq_m2r (*src2, mm3); /* load 8 src2 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
136 movq_r2r (mm3, mm4); /* copy 8 src2 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
138 punpcklbw_r2r (mm0, mm3); /* unpack low src2 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
139 punpckhbw_r2r (mm0, mm4); /* unpack high src2 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
141 paddw_r2r (mm3, mm1); /* add lows */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
142 paddw_r2r (mm4, mm2); /* add highs */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
143
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
144 /* now have partials in mm1 and mm2 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
145
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
146 movq_m2r (*src3, mm3); /* load 8 src3 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
147 movq_r2r (mm3, mm4); /* copy 8 src3 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
149 punpcklbw_r2r (mm0, mm3); /* unpack low src3 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
150 punpckhbw_r2r (mm0, mm4); /* unpack high src3 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
151
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
152 paddw_r2r (mm3, mm1); /* add lows */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
153 paddw_r2r (mm4, mm2); /* add highs */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
154
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
155 movq_m2r (*src4, mm5); /* load 8 src4 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
156 movq_r2r (mm5, mm6); /* copy 8 src4 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
157
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
158 punpcklbw_r2r (mm0, mm5); /* unpack low src4 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
159 punpckhbw_r2r (mm0, mm6); /* unpack high src4 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
160
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
161 paddw_r2r (mm5, mm1); /* add lows */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
162 paddw_r2r (mm6, mm2); /* add highs */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
163
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
164 /* now have subtotal in mm1 and mm2 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166 paddw_m2r (round4, mm1);
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
167 psraw_i2r (2, mm1); /* /4 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
168 paddw_m2r (round4, mm2);
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
169 psraw_i2r (2, mm2); /* /4 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
170
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
171 packuswb_r2r (mm2, mm1); /* pack (w/ saturation) */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
172 movq_r2m (mm1, *dest); /* store result in dest */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
175 static inline void mmx_interp_average_4_U8 (uint8_t * dest,
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
176 const uint8_t * src1,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
177 const uint8_t * src2,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
178 const uint8_t * src3,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
179 const uint8_t * src4)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
180 {
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
181 /* *dest = (*dest + (*src1 + *src2 + *src3 + *src4 + 2)/ 4 + 1)/ 2; */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
182
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
183 movq_m2r (*src1, mm1); /* load 8 src1 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
184 movq_r2r (mm1, mm2); /* copy 8 src1 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
185
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
186 punpcklbw_r2r (mm0, mm1); /* unpack low src1 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
187 punpckhbw_r2r (mm0, mm2); /* unpack high src1 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
188
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
189 movq_m2r (*src2, mm3); /* load 8 src2 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
190 movq_r2r (mm3, mm4); /* copy 8 src2 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
191
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
192 punpcklbw_r2r (mm0, mm3); /* unpack low src2 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
193 punpckhbw_r2r (mm0, mm4); /* unpack high src2 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
195 paddw_r2r (mm3, mm1); /* add lows */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
196 paddw_r2r (mm4, mm2); /* add highs */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
197
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
198 /* now have partials in mm1 and mm2 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
199
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
200 movq_m2r (*src3, mm3); /* load 8 src3 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
201 movq_r2r (mm3, mm4); /* copy 8 src3 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
202
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
203 punpcklbw_r2r (mm0, mm3); /* unpack low src3 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
204 punpckhbw_r2r (mm0, mm4); /* unpack high src3 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
205
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
206 paddw_r2r (mm3, mm1); /* add lows */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
207 paddw_r2r (mm4, mm2); /* add highs */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
208
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
209 movq_m2r (*src4, mm5); /* load 8 src4 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
210 movq_r2r (mm5, mm6); /* copy 8 src4 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
211
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
212 punpcklbw_r2r (mm0, mm5); /* unpack low src4 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
213 punpckhbw_r2r (mm0, mm6); /* unpack high src4 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
214
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
215 paddw_r2r (mm5, mm1); /* add lows */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
216 paddw_r2r (mm6, mm2); /* add highs */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
218 paddw_m2r (round4, mm1);
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
219 psraw_i2r (2, mm1); /* /4 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
220 paddw_m2r (round4, mm2);
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
221 psraw_i2r (2, mm2); /* /4 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
222
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
223 /* now have subtotal/4 in mm1 and mm2 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
224
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
225 movq_m2r (*dest, mm3); /* load 8 dest bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
226 movq_r2r (mm3, mm4); /* copy 8 dest bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
227
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
228 packuswb_r2r (mm2, mm1); /* pack (w/ saturation) */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
229 movq_r2r (mm1,mm2); /* copy subresult */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
230
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
231 pxor_r2r (mm1, mm3); /* xor srcavg and dest */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
232 pand_m2r (mask1, mm3); /* mask lower bits */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
233 psrlq_i2r (1, mm3); /* /2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
234 por_r2r (mm2, mm4); /* or srcavg and dest */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
235 psubb_r2r (mm3, mm4); /* subtract subresults */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
236 movq_r2m (mm4, *dest); /* store result in dest */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
237 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
238
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
239 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
240
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
241 static inline void MC_avg_mmx (const int width, int height, uint8_t * dest,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
242 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
243 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
244 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
245
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
246 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
247 mmx_average_2_U8 (dest, dest, ref);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
248
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
249 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
250 mmx_average_2_U8 (dest+8, dest+8, ref+8);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
251
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
252 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
253 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
254 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
255 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
256
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
257 static void MC_avg_o_16_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
258 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
259 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
260 MC_avg_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
261 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
262
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
263 static void MC_avg_o_8_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
264 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
265 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
266 MC_avg_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
267 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
268
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
269 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
270
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
271 static inline void MC_put_mmx (const int width, int height, uint8_t * dest,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
272 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
273 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
274 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
275
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
276 do {
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
277 movq_m2r (* ref, mm1); /* load 8 ref bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
278 movq_r2m (mm1,* dest); /* store 8 bytes at curr */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
279
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
280 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
281 {
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
282 movq_m2r (* (ref+8), mm1); /* load 8 ref bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
283 movq_r2m (mm1,* (dest+8)); /* store 8 bytes at curr */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
284 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
285
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
286 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
287 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
288 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
289 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
290
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
291 static void MC_put_o_16_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
292 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
293 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
294 MC_put_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
295 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
296
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
297 static void MC_put_o_8_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
298 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
299 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
300 MC_put_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
301 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
302
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
303 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
304
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
305 /* Half pixel interpolation in the x direction */
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
306 static inline void MC_avg_x_mmx (const int width, int height, uint8_t * dest,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
307 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
308 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
309 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
310
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
311 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
312 mmx_interp_average_2_U8 (dest, ref, ref+1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
313
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
314 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
315 mmx_interp_average_2_U8 (dest+8, ref+8, ref+9);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
316
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
317 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
318 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
319 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
320 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
321
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
322 static void MC_avg_x_16_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
323 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
324 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
325 MC_avg_x_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
326 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
327
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
328 static void MC_avg_x_8_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
329 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
330 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
331 MC_avg_x_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
332 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
333
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
334 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
335
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
336 static inline void MC_put_x_mmx (const int width, int height, uint8_t * dest,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
337 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
338 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
339 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
340
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
341 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
342 mmx_average_2_U8 (dest, ref, ref+1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
343
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
344 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
345 mmx_average_2_U8 (dest+8, ref+8, ref+9);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
346
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
347 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
348 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
349 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
350 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
351
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
352 static void MC_put_x_16_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
353 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
354 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
355 MC_put_x_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
356 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
357
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
358 static void MC_put_x_8_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
359 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
360 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
361 MC_put_x_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
362 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
363
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
364 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
365
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
366 static inline void MC_avg_xy_mmx (const int width, int height, uint8_t * dest,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
367 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
368 {
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
369 const uint8_t * ref_next = ref + stride;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
370
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
371 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
372
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
373 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
374 mmx_interp_average_4_U8 (dest, ref, ref+1, ref_next, ref_next+1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
375
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
376 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
377 mmx_interp_average_4_U8 (dest+8, ref+8, ref+9,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
378 ref_next+8, ref_next+9);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
379
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
380 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
381 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
382 ref_next += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
383 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
384 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
385
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
386 static void MC_avg_xy_16_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
387 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
388 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
389 MC_avg_xy_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
390 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
391
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
392 static void MC_avg_xy_8_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
393 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
394 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
395 MC_avg_xy_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
396 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
397
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
398 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
399
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
400 static inline void MC_put_xy_mmx (const int width, int height, uint8_t * dest,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
401 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
402 {
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
403 const uint8_t * ref_next = ref + stride;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
404
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
405 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
406
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
407 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
408 mmx_average_4_U8 (dest, ref, ref+1, ref_next, ref_next+1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
409
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
410 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
411 mmx_average_4_U8 (dest+8, ref+8, ref+9, ref_next+8, ref_next+9);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
412
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
413 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
414 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
415 ref_next += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
416 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
417 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
418
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
419 static void MC_put_xy_16_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
420 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
421 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
422 MC_put_xy_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
423 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
424
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
425 static void MC_put_xy_8_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
426 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
427 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
428 MC_put_xy_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
429 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
430
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
431 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
432
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
433 static inline void MC_avg_y_mmx (const int width, int height, uint8_t * dest,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
434 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
435 {
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
436 const uint8_t * ref_next = ref + stride;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
437
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
438 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
439
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
440 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
441 mmx_interp_average_2_U8 (dest, ref, ref_next);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
442
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
443 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
444 mmx_interp_average_2_U8 (dest+8, ref+8, ref_next+8);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
445
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
446 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
447 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
448 ref_next += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
449 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
450 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
451
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
452 static void MC_avg_y_16_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
453 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
454 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
455 MC_avg_y_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
456 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
457
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
458 static void MC_avg_y_8_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
459 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
460 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
461 MC_avg_y_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
462 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
463
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
464 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
465
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
466 static inline void MC_put_y_mmx (const int width, int height, uint8_t * dest,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
467 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
468 {
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
469 const uint8_t * ref_next = ref + stride;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
470
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
471 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
472
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
473 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
474 mmx_average_2_U8 (dest, ref, ref_next);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
475
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
476 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
477 mmx_average_2_U8 (dest+8, ref+8, ref_next+8);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
478
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
479 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
480 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
481 ref_next += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
482 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
483 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
484
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
485 static void MC_put_y_16_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
486 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
487 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
488 MC_put_y_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
489 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
490
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
491 static void MC_put_y_8_mmx (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
492 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
493 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
494 MC_put_y_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
495 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
496
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
497
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
498 MPEG2_MC_EXTERN (mmx)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
499
30255
e41a2492e665 Avoid linking in assembler-optimized code that will never be used.
reimar
parents: 28290
diff changeset
500 #endif /* HAVE_MMX */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
501
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
502
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
503
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
504
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
505
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
506
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
507 /* CPU_MMXEXT/CPU_3DNOW adaptation layer */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
508
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
509 #define pavg_r2r(src,dest) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
510 do { \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
511 if (cpu == CPU_MMXEXT) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
512 pavgb_r2r (src, dest); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
513 else \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
514 pavgusb_r2r (src, dest); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
515 } while (0)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
516
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
517 #define pavg_m2r(src,dest) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
518 do { \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
519 if (cpu == CPU_MMXEXT) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
520 pavgb_m2r (src, dest); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
521 else \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
522 pavgusb_m2r (src, dest); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
523 } while (0)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
524
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
525
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
526 /* CPU_MMXEXT code */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
527
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
528
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
529 static inline void MC_put1_8 (int height, uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
530 const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
531 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
532 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
533 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
534 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
535 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
536 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
537 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
538 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
539
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
540 static inline void MC_put1_16 (int height, uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
541 const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
542 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
543 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
544 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
545 movq_m2r (*(ref+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
546 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
547 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
548 movq_r2m (mm1, *(dest+8));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
549 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
550 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
551 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
552
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
553 static inline void MC_avg1_8 (int height, uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
554 const int stride, const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
555 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
556 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
557 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
558 pavg_m2r (*dest, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
559 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
560 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
561 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
562 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
563 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
564
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
565 static inline void MC_avg1_16 (int height, uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
566 const int stride, const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
567 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
568 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
569 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
570 movq_m2r (*(ref+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
571 pavg_m2r (*dest, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
572 pavg_m2r (*(dest+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
573 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
574 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
575 movq_r2m (mm1, *(dest+8));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
576 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
577 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
578 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
579
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
580 static inline void MC_put2_8 (int height, uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
581 const int stride, const int offset,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
582 const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
583 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
584 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
585 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
586 pavg_m2r (*(ref+offset), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
587 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
588 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
589 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
590 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
591 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
592
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
593 static inline void MC_put2_16 (int height, uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
594 const int stride, const int offset,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
595 const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
596 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
597 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
598 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
599 movq_m2r (*(ref+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
600 pavg_m2r (*(ref+offset), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
601 pavg_m2r (*(ref+offset+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
602 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
603 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
604 movq_r2m (mm1, *(dest+8));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
605 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
606 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
607 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
608
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
609 static inline void MC_avg2_8 (int height, uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
610 const int stride, const int offset,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
611 const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
612 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
613 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
614 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
615 pavg_m2r (*(ref+offset), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
616 pavg_m2r (*dest, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
617 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
618 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
619 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
620 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
621 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
622
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
623 static inline void MC_avg2_16 (int height, uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
624 const int stride, const int offset,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
625 const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
626 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
627 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
628 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
629 movq_m2r (*(ref+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
630 pavg_m2r (*(ref+offset), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
631 pavg_m2r (*(ref+offset+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
632 pavg_m2r (*dest, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
633 pavg_m2r (*(dest+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
634 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
635 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
636 movq_r2m (mm1, *(dest+8));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
637 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
638 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
639 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
640
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
641 static mmx_t mask_one = {0x0101010101010101LL};
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
642
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
643 static inline void MC_put4_8 (int height, uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
644 const int stride, const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
645 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
646 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
647 movq_m2r (*(ref+1), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
648 movq_r2r (mm0, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
649 pxor_r2r (mm1, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
650 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
651 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
652
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
653 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
654 movq_m2r (*ref, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
655 movq_r2r (mm0, mm5);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
656
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
657 movq_m2r (*(ref+1), mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
658 movq_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
659
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
660 pxor_r2r (mm3, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
661 pavg_r2r (mm3, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
662
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
663 por_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
664 pxor_r2r (mm2, mm5);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
665
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
666 pand_r2r (mm5, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
667 pavg_r2r (mm2, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
668
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
669 pand_m2r (mask_one, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
670
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
671 psubusb_r2r (mm7, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
672
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
673 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
674 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
675 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
676
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
677 movq_r2r (mm6, mm7); /* unroll ! */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
678 movq_r2r (mm2, mm0); /* unroll ! */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
679 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
680 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
681
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
682 static inline void MC_put4_16 (int height, uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
683 const int stride, const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
684 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
685 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
686 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
687 movq_m2r (*(ref+stride+1), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
688 movq_r2r (mm0, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
689 movq_m2r (*(ref+1), mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
690 pxor_r2r (mm1, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
691 movq_m2r (*(ref+stride), mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
692 movq_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
693 pxor_r2r (mm3, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
694 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
695 pavg_r2r (mm3, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
696 por_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
697 movq_r2r (mm0, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
698 pxor_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
699 pand_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
700 pand_m2r (mask_one, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
701 pavg_r2r (mm2, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
702 psubusb_r2r (mm7, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
703 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
704
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
705 movq_m2r (*(ref+8), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
706 movq_m2r (*(ref+stride+9), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
707 movq_r2r (mm0, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
708 movq_m2r (*(ref+9), mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
709 pxor_r2r (mm1, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
710 movq_m2r (*(ref+stride+8), mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
711 movq_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
712 pxor_r2r (mm3, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
713 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
714 pavg_r2r (mm3, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
715 por_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
716 movq_r2r (mm0, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
717 pxor_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
718 pand_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
719 pand_m2r (mask_one, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
720 pavg_r2r (mm2, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
721 psubusb_r2r (mm7, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
722 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
723 movq_r2m (mm0, *(dest+8));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
724 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
725 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
726 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
727
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
728 static inline void MC_avg4_8 (int height, uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
729 const int stride, const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
730 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
731 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
732 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
733 movq_m2r (*(ref+stride+1), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
734 movq_r2r (mm0, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
735 movq_m2r (*(ref+1), mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
736 pxor_r2r (mm1, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
737 movq_m2r (*(ref+stride), mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
738 movq_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
739 pxor_r2r (mm3, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
740 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
741 pavg_r2r (mm3, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
742 por_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
743 movq_r2r (mm0, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
744 pxor_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
745 pand_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
746 pand_m2r (mask_one, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
747 pavg_r2r (mm2, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
748 psubusb_r2r (mm7, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
749 movq_m2r (*dest, mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
750 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
751 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
752 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
753 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
754 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
755 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
756
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
757 static inline void MC_avg4_16 (int height, uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
758 const int stride, const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
759 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
760 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
761 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
762 movq_m2r (*(ref+stride+1), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
763 movq_r2r (mm0, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
764 movq_m2r (*(ref+1), mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
765 pxor_r2r (mm1, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
766 movq_m2r (*(ref+stride), mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
767 movq_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
768 pxor_r2r (mm3, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
769 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
770 pavg_r2r (mm3, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
771 por_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
772 movq_r2r (mm0, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
773 pxor_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
774 pand_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
775 pand_m2r (mask_one, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
776 pavg_r2r (mm2, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
777 psubusb_r2r (mm7, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
778 movq_m2r (*dest, mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
779 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
780 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
781
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
782 movq_m2r (*(ref+8), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
783 movq_m2r (*(ref+stride+9), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
784 movq_r2r (mm0, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
785 movq_m2r (*(ref+9), mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
786 pxor_r2r (mm1, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
787 movq_m2r (*(ref+stride+8), mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
788 movq_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
789 pxor_r2r (mm3, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
790 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
791 pavg_r2r (mm3, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
792 por_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
793 movq_r2r (mm0, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
794 pxor_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
795 pand_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
796 pand_m2r (mask_one, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
797 pavg_r2r (mm2, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
798 psubusb_r2r (mm7, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
799 movq_m2r (*(dest+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
800 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
801 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
802 movq_r2m (mm0, *(dest+8));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
803 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
804 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
805 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
806
30255
e41a2492e665 Avoid linking in assembler-optimized code that will never be used.
reimar
parents: 28290
diff changeset
807 #if HAVE_MMX2
e41a2492e665 Avoid linking in assembler-optimized code that will never be used.
reimar
parents: 28290
diff changeset
808
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
809 static void MC_avg_o_16_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
810 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
811 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
812 MC_avg1_16 (height, dest, ref, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
813 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
814
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
815 static void MC_avg_o_8_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
816 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
817 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
818 MC_avg1_8 (height, dest, ref, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
819 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
820
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
821 static void MC_put_o_16_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
822 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
823 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
824 MC_put1_16 (height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
825 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
826
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
827 static void MC_put_o_8_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
828 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
829 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
830 MC_put1_8 (height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
831 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
832
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
833 static void MC_avg_x_16_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
834 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
835 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
836 MC_avg2_16 (height, dest, ref, stride, 1, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
837 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
838
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
839 static void MC_avg_x_8_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
840 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
841 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
842 MC_avg2_8 (height, dest, ref, stride, 1, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
843 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
844
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
845 static void MC_put_x_16_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
846 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
847 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
848 MC_put2_16 (height, dest, ref, stride, 1, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
849 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
850
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
851 static void MC_put_x_8_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
852 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
853 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
854 MC_put2_8 (height, dest, ref, stride, 1, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
855 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
856
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
857 static void MC_avg_y_16_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
858 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
859 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
860 MC_avg2_16 (height, dest, ref, stride, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
861 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
862
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
863 static void MC_avg_y_8_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
864 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
865 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
866 MC_avg2_8 (height, dest, ref, stride, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
867 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
868
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
869 static void MC_put_y_16_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
870 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
871 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
872 MC_put2_16 (height, dest, ref, stride, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
873 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
874
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
875 static void MC_put_y_8_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
876 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
877 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
878 MC_put2_8 (height, dest, ref, stride, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
879 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
880
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
881 static void MC_avg_xy_16_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
882 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
883 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
884 MC_avg4_16 (height, dest, ref, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
885 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
886
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
887 static void MC_avg_xy_8_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
888 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
889 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
890 MC_avg4_8 (height, dest, ref, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
891 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
892
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
893 static void MC_put_xy_16_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
894 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
895 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
896 MC_put4_16 (height, dest, ref, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
897 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
898
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
899 static void MC_put_xy_8_mmxext (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
900 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
901 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
902 MC_put4_8 (height, dest, ref, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
903 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
904
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
905
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
906 MPEG2_MC_EXTERN (mmxext)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
907
30255
e41a2492e665 Avoid linking in assembler-optimized code that will never be used.
reimar
parents: 28290
diff changeset
908 #endif /* HAVE_MMX2 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
909
30255
e41a2492e665 Avoid linking in assembler-optimized code that will never be used.
reimar
parents: 28290
diff changeset
910 #if HAVE_AMD3DNOW
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
911
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
912 static void MC_avg_o_16_3dnow (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
913 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
914 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
915 MC_avg1_16 (height, dest, ref, stride, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
916 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
917
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
918 static void MC_avg_o_8_3dnow (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
919 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
920 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
921 MC_avg1_8 (height, dest, ref, stride, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
922 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
923
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
924 static void MC_put_o_16_3dnow (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
925 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
926 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
927 MC_put1_16 (height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
928 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
929
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
930 static void MC_put_o_8_3dnow (uint8_t * dest, const uint8_t * ref,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
931 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
932 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
933 MC_put1_8 (height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
934 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
935
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
936 static void MC_avg_x_16_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
937 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
938 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
939 MC_avg2_16 (height, dest, ref, stride, 1, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
940 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
941
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
942 static void MC_avg_x_8_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
943 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
944 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
945 MC_avg2_8 (height, dest, ref, stride, 1, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
946 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
947
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
948 static void MC_put_x_16_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
949 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
950 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
951 MC_put2_16 (height, dest, ref, stride, 1, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
952 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
953
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
954 static void MC_put_x_8_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
955 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
956 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
957 MC_put2_8 (height, dest, ref, stride, 1, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
958 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
959
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
960 static void MC_avg_y_16_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
961 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
962 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
963 MC_avg2_16 (height, dest, ref, stride, stride, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
964 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
965
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
966 static void MC_avg_y_8_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
967 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
968 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
969 MC_avg2_8 (height, dest, ref, stride, stride, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
970 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
971
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
972 static void MC_put_y_16_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
973 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
974 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
975 MC_put2_16 (height, dest, ref, stride, stride, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
976 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
977
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
978 static void MC_put_y_8_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
979 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
980 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
981 MC_put2_8 (height, dest, ref, stride, stride, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
982 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
983
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
984 static void MC_avg_xy_16_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
985 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
986 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
987 MC_avg4_16 (height, dest, ref, stride, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
988 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
989
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
990 static void MC_avg_xy_8_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
991 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
992 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
993 MC_avg4_8 (height, dest, ref, stride, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
994 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
995
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
996 static void MC_put_xy_16_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
997 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
998 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
999 MC_put4_16 (height, dest, ref, stride, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1000 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1001
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
1002 static void MC_put_xy_8_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1003 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1004 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1005 MC_put4_8 (height, dest, ref, stride, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1006 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1007
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1008
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
1009 MPEG2_MC_EXTERN (3dnow)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1010
30255
e41a2492e665 Avoid linking in assembler-optimized code that will never be used.
reimar
parents: 28290
diff changeset
1011 #endif /* HAVE_AMD3DNOW */
e41a2492e665 Avoid linking in assembler-optimized code that will never be used.
reimar
parents: 28290
diff changeset
1012
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1013 #endif