annotate libmpeg2/motion_comp_mmx.c @ 14297:85ec4f714596

Use libc qsort to sort ODML index. Based on patch by phillip at phdcam dot com
author reimar
date Sun, 02 Jan 2005 14:29:43 +0000
parents 96259a2f2142
children 1385ec491ffb
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
13864
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 12932
diff changeset
26 #if defined(ARCH_X86) || defined(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
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
39 /* MMX code - needs a rewrite */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
41 /*
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
42 * Motion Compensation frequently needs to average values using the
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
43 * 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
44 * 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
45 *
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
46 * We need to be careful of overflows when doing this computation.
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
47 * Rather than unpacking data to 16-bits, which reduces parallelism,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
48 * we use the following formulas:
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
49 *
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
50 * (x+y)>>1 == (x&y)+((x^y)>>1)
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
51 * (x+y+1)>>1 == (x|y)-((x^y)>>1)
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
52 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
54 /* some rounding constants */
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
55 static mmx_t mask1 = {0xfefefefefefefefeLL};
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
56 static mmx_t round4 = {0x0002000200020002LL};
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 * This code should probably be compiled with loop unrolling
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 * (ie, -funroll-loops in gcc)becuase some of the loops
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 * use a small static number of iterations. This was written
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 * with the assumption the compiler knows best about when
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 * unrolling will help
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 static inline void mmx_zero_reg ()
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 {
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
68 /* load 0 into mm0 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 pxor_r2r (mm0, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
72 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
73 const uint8_t * src2)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74 {
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
75 /* *dest = (*src1 + *src2 + 1)/ 2; */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
77 movq_m2r (*src1, mm1); /* load 8 src1 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
78 movq_r2r (mm1, mm2); /* copy 8 src1 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
80 movq_m2r (*src2, mm3); /* load 8 src2 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
81 movq_r2r (mm3, mm4); /* copy 8 src2 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
83 pxor_r2r (mm1, mm3); /* xor src1 and src2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
84 pand_m2r (mask1, mm3); /* mask lower bits */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
85 psrlq_i2r (1, mm3); /* /2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
86 por_r2r (mm2, mm4); /* or src1 and src2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
87 psubb_r2r (mm3, mm4); /* subtract subresults */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
88 movq_r2m (mm4, *dest); /* store result in dest */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91 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
92 const uint8_t * src1,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
93 const uint8_t * src2)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 {
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
95 /* *dest = (*dest + (*src1 + *src2 + 1)/ 2 + 1)/ 2; */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
97 movq_m2r (*dest, mm1); /* load 8 dest bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
98 movq_r2r (mm1, mm2); /* copy 8 dest bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
100 movq_m2r (*src1, mm3); /* load 8 src1 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
101 movq_r2r (mm3, mm4); /* copy 8 src1 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
103 movq_m2r (*src2, mm5); /* load 8 src2 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
104 movq_r2r (mm5, mm6); /* copy 8 src2 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
106 pxor_r2r (mm3, mm5); /* xor src1 and src2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
107 pand_m2r (mask1, mm5); /* mask lower bits */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
108 psrlq_i2r (1, mm5); /* /2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
109 por_r2r (mm4, mm6); /* or src1 and src2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
110 psubb_r2r (mm5, mm6); /* subtract subresults */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
111 movq_r2r (mm6, mm5); /* copy subresult */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
113 pxor_r2r (mm1, mm5); /* xor srcavg and dest */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
114 pand_m2r (mask1, mm5); /* mask lower bits */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
115 psrlq_i2r (1, mm5); /* /2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
116 por_r2r (mm2, mm6); /* or srcavg and dest */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
117 psubb_r2r (mm5, mm6); /* subtract subresults */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
118 movq_r2m (mm6, *dest); /* store result in dest */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
121 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
122 const uint8_t * src2,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
123 const uint8_t * src3,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
124 const uint8_t * src4)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125 {
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
126 /* *dest = (*src1 + *src2 + *src3 + *src4 + 2)/ 4; */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
127
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
128 movq_m2r (*src1, mm1); /* load 8 src1 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
129 movq_r2r (mm1, mm2); /* copy 8 src1 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
130
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
131 punpcklbw_r2r (mm0, mm1); /* unpack low src1 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
132 punpckhbw_r2r (mm0, mm2); /* unpack high src1 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
133
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
134 movq_m2r (*src2, mm3); /* load 8 src2 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
135 movq_r2r (mm3, mm4); /* copy 8 src2 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
136
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
137 punpcklbw_r2r (mm0, mm3); /* unpack low src2 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
138 punpckhbw_r2r (mm0, mm4); /* unpack high src2 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
139
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
140 paddw_r2r (mm3, mm1); /* add lows */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
141 paddw_r2r (mm4, mm2); /* add highs */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
143 /* now have partials in mm1 and mm2 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
144
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
145 movq_m2r (*src3, mm3); /* load 8 src3 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
146 movq_r2r (mm3, mm4); /* copy 8 src3 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
147
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
148 punpcklbw_r2r (mm0, mm3); /* unpack low src3 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
149 punpckhbw_r2r (mm0, mm4); /* unpack high src3 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
150
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
151 paddw_r2r (mm3, mm1); /* add lows */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
152 paddw_r2r (mm4, mm2); /* add highs */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
153
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
154 movq_m2r (*src4, mm5); /* load 8 src4 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
155 movq_r2r (mm5, mm6); /* copy 8 src4 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
156
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
157 punpcklbw_r2r (mm0, mm5); /* unpack low src4 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
158 punpckhbw_r2r (mm0, mm6); /* unpack high src4 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
160 paddw_r2r (mm5, mm1); /* add lows */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
161 paddw_r2r (mm6, mm2); /* add highs */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
162
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
163 /* now have subtotal in mm1 and mm2 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165 paddw_m2r (round4, mm1);
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
166 psraw_i2r (2, mm1); /* /4 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167 paddw_m2r (round4, mm2);
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
168 psraw_i2r (2, mm2); /* /4 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
170 packuswb_r2r (mm2, mm1); /* pack (w/ saturation) */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
171 movq_r2m (mm1, *dest); /* store result in dest */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
172 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174 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
175 const uint8_t * src1,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
176 const uint8_t * src2,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
177 const uint8_t * src3,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
178 const uint8_t * src4)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
179 {
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
180 /* *dest = (*dest + (*src1 + *src2 + *src3 + *src4 + 2)/ 4 + 1)/ 2; */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
181
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
182 movq_m2r (*src1, mm1); /* load 8 src1 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
183 movq_r2r (mm1, mm2); /* copy 8 src1 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
184
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
185 punpcklbw_r2r (mm0, mm1); /* unpack low src1 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
186 punpckhbw_r2r (mm0, mm2); /* unpack high src1 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
187
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
188 movq_m2r (*src2, mm3); /* load 8 src2 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
189 movq_r2r (mm3, mm4); /* copy 8 src2 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
191 punpcklbw_r2r (mm0, mm3); /* unpack low src2 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
192 punpckhbw_r2r (mm0, mm4); /* unpack high src2 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
193
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
194 paddw_r2r (mm3, mm1); /* add lows */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
195 paddw_r2r (mm4, mm2); /* add highs */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
196
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
197 /* now have partials in mm1 and mm2 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
198
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
199 movq_m2r (*src3, mm3); /* load 8 src3 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
200 movq_r2r (mm3, mm4); /* copy 8 src3 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
201
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
202 punpcklbw_r2r (mm0, mm3); /* unpack low src3 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
203 punpckhbw_r2r (mm0, mm4); /* unpack high src3 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
204
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
205 paddw_r2r (mm3, mm1); /* add lows */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
206 paddw_r2r (mm4, mm2); /* add highs */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
207
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
208 movq_m2r (*src4, mm5); /* load 8 src4 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
209 movq_r2r (mm5, mm6); /* copy 8 src4 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
210
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
211 punpcklbw_r2r (mm0, mm5); /* unpack low src4 bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
212 punpckhbw_r2r (mm0, mm6); /* unpack high src4 bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
213
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
214 paddw_r2r (mm5, mm1); /* add lows */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
215 paddw_r2r (mm6, mm2); /* add highs */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
216
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217 paddw_m2r (round4, mm1);
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
218 psraw_i2r (2, mm1); /* /4 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
219 paddw_m2r (round4, mm2);
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
220 psraw_i2r (2, mm2); /* /4 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
221
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
222 /* now have subtotal/4 in mm1 and mm2 */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
223
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
224 movq_m2r (*dest, mm3); /* load 8 dest bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
225 movq_r2r (mm3, mm4); /* copy 8 dest bytes */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
226
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
227 packuswb_r2r (mm2, mm1); /* pack (w/ saturation) */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
228 movq_r2r (mm1,mm2); /* copy subresult */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
229
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
230 pxor_r2r (mm1, mm3); /* xor srcavg and dest */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
231 pand_m2r (mask1, mm3); /* mask lower bits */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
232 psrlq_i2r (1, mm3); /* /2 */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
233 por_r2r (mm2, mm4); /* or srcavg and dest */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
234 psubb_r2r (mm3, mm4); /* subtract subresults */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
235 movq_r2m (mm4, *dest); /* store result in dest */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
236 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
237
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
238 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
239
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
240 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
241 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
242 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
243 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
244
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
245 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
246 mmx_average_2_U8 (dest, dest, ref);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
247
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
248 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
249 mmx_average_2_U8 (dest+8, dest+8, ref+8);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
250
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
251 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
252 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
253 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
254 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
255
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
256 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
257 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
258 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
259 MC_avg_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
260 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
261
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
262 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
263 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
264 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
265 MC_avg_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
266 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
267
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
268 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
269
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
270 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
271 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
272 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
273 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
274
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
275 do {
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
276 movq_m2r (* ref, mm1); /* load 8 ref bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
277 movq_r2m (mm1,* dest); /* store 8 bytes at curr */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
278
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
279 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
280 {
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
281 movq_m2r (* (ref+8), mm1); /* load 8 ref bytes */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
282 movq_r2m (mm1,* (dest+8)); /* store 8 bytes at curr */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
283 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
284
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
285 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
286 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
287 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
288 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
289
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
290 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
291 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
292 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
293 MC_put_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
294 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
295
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
296 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
297 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
298 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
299 MC_put_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
300 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
301
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
302 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
303
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
304 /* Half pixel interpolation in the x direction */
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
305 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
306 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
307 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
308 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
309
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
310 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
311 mmx_interp_average_2_U8 (dest, ref, ref+1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
312
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
313 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
314 mmx_interp_average_2_U8 (dest+8, ref+8, ref+9);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
315
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
316 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
317 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
318 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
319 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
320
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
321 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
322 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
323 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
324 MC_avg_x_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
325 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
326
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
327 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
328 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
329 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
330 MC_avg_x_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
331 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
332
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
333 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
334
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
335 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
336 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
337 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
338 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
339
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
340 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
341 mmx_average_2_U8 (dest, ref, ref+1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
342
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
343 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
344 mmx_average_2_U8 (dest+8, ref+8, ref+9);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
345
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
346 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
347 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
348 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
349 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
350
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
351 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
352 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
353 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
354 MC_put_x_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
355 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
356
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
357 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
358 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
359 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
360 MC_put_x_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
361 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
362
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
363 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
364
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
365 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
366 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
367 {
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
368 const uint8_t * ref_next = ref + stride;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
369
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
370 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
371
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
372 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
373 mmx_interp_average_4_U8 (dest, ref, ref+1, ref_next, ref_next+1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
374
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
375 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
376 mmx_interp_average_4_U8 (dest+8, ref+8, ref+9,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
377 ref_next+8, ref_next+9);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
378
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
379 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
380 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
381 ref_next += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
382 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
383 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
384
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
385 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
386 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
387 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
388 MC_avg_xy_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
389 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
390
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
391 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
392 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
393 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
394 MC_avg_xy_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
395 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
396
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
397 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
398
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
399 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
400 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
401 {
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
402 const uint8_t * ref_next = ref + stride;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
403
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
404 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
405
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
406 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
407 mmx_average_4_U8 (dest, ref, ref+1, ref_next, ref_next+1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
408
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
409 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
410 mmx_average_4_U8 (dest+8, ref+8, ref+9, ref_next+8, ref_next+9);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
411
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
412 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
413 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
414 ref_next += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
415 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
416 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
417
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
418 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
419 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
420 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
421 MC_put_xy_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
422 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
423
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
424 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
425 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
426 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
427 MC_put_xy_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
428 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
429
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
430 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
431
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
432 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
433 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
434 {
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
435 const uint8_t * ref_next = ref + stride;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
436
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
437 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
438
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
439 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
440 mmx_interp_average_2_U8 (dest, ref, ref_next);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
441
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
442 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
443 mmx_interp_average_2_U8 (dest+8, ref+8, ref_next+8);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
444
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
445 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
446 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
447 ref_next += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
448 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
449 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
450
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
451 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
452 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
453 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
454 MC_avg_y_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
455 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
456
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
457 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
458 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
459 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
460 MC_avg_y_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
461 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
462
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
463 /*-----------------------------------------------------------------------*/
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
464
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
465 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
466 const uint8_t * ref, const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
467 {
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
468 const uint8_t * ref_next = ref + stride;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
469
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
470 mmx_zero_reg ();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
471
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
472 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
473 mmx_average_2_U8 (dest, ref, ref_next);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
474
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
475 if (width == 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
476 mmx_average_2_U8 (dest+8, ref+8, ref_next+8);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
477
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
478 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
479 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
480 ref_next += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
481 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
482 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
483
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
484 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
485 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
486 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
487 MC_put_y_mmx (16, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
488 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
489
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
490 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
491 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
492 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
493 MC_put_y_mmx (8, height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
494 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
495
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
496
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
497 MPEG2_MC_EXTERN (mmx)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
498
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
499
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
500
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
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
505 /* CPU_MMXEXT/CPU_3DNOW adaptation layer */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
506
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
507 #define pavg_r2r(src,dest) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
508 do { \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
509 if (cpu == CPU_MMXEXT) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
510 pavgb_r2r (src, dest); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
511 else \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
512 pavgusb_r2r (src, dest); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
513 } while (0)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
514
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
515 #define pavg_m2r(src,dest) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
516 do { \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
517 if (cpu == CPU_MMXEXT) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
518 pavgb_m2r (src, dest); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
519 else \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
520 pavgusb_m2r (src, dest); \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
521 } while (0)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
522
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
523
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
524 /* CPU_MMXEXT code */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
525
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
526
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
527 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
528 const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
529 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
530 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
531 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
532 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
533 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
534 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
535 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
536 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
537
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
538 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
539 const int stride)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
540 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
541 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
542 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
543 movq_m2r (*(ref+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
544 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
545 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
546 movq_r2m (mm1, *(dest+8));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
547 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
548 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
549 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
550
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
551 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
552 const int stride, const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
553 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
554 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
555 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
556 pavg_m2r (*dest, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
557 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
558 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
559 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
560 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
561 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
562
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
563 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
564 const int stride, const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
565 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
566 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
567 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
568 movq_m2r (*(ref+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
569 pavg_m2r (*dest, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
570 pavg_m2r (*(dest+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
571 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
572 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
573 movq_r2m (mm1, *(dest+8));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
574 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
575 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
576 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
577
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
578 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
579 const int stride, const int offset,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
580 const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
581 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
582 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
583 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
584 pavg_m2r (*(ref+offset), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
585 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
586 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
587 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
588 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
589 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
590
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
591 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
592 const int stride, const int offset,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
593 const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
594 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
595 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
596 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
597 movq_m2r (*(ref+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
598 pavg_m2r (*(ref+offset), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
599 pavg_m2r (*(ref+offset+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
600 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
601 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
602 movq_r2m (mm1, *(dest+8));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
603 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
604 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
605 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
606
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
607 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
608 const int stride, const int offset,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
609 const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
610 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
611 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
612 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
613 pavg_m2r (*(ref+offset), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
614 pavg_m2r (*dest, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
615 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
616 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
617 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
618 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
619 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
620
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
621 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
622 const int stride, const int offset,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
623 const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
624 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
625 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
626 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
627 movq_m2r (*(ref+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
628 pavg_m2r (*(ref+offset), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
629 pavg_m2r (*(ref+offset+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
630 pavg_m2r (*dest, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
631 pavg_m2r (*(dest+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
632 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
633 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
634 movq_r2m (mm1, *(dest+8));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
635 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
636 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
637 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
638
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
639 static mmx_t mask_one = {0x0101010101010101LL};
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
640
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
641 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
642 const int stride, const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
643 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
644 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
645 movq_m2r (*(ref+1), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
646 movq_r2r (mm0, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
647 pxor_r2r (mm1, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
648 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
649 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
650
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
651 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
652 movq_m2r (*ref, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
653 movq_r2r (mm0, mm5);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
654
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
655 movq_m2r (*(ref+1), mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
656 movq_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
657
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
658 pxor_r2r (mm3, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
659 pavg_r2r (mm3, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
660
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
661 por_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
662 pxor_r2r (mm2, mm5);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
663
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
664 pand_r2r (mm5, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
665 pavg_r2r (mm2, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
666
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
667 pand_m2r (mask_one, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
668
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
669 psubusb_r2r (mm7, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
670
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
671 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
672 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
673 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
674
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
675 movq_r2r (mm6, mm7); /* unroll ! */
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
676 movq_r2r (mm2, mm0); /* unroll ! */
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
677 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
678 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
679
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
680 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
681 const int stride, const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
682 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
683 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
684 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
685 movq_m2r (*(ref+stride+1), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
686 movq_r2r (mm0, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
687 movq_m2r (*(ref+1), mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
688 pxor_r2r (mm1, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
689 movq_m2r (*(ref+stride), mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
690 movq_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
691 pxor_r2r (mm3, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
692 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
693 pavg_r2r (mm3, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
694 por_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
695 movq_r2r (mm0, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
696 pxor_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
697 pand_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
698 pand_m2r (mask_one, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
699 pavg_r2r (mm2, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
700 psubusb_r2r (mm7, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
701 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
702
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
703 movq_m2r (*(ref+8), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
704 movq_m2r (*(ref+stride+9), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
705 movq_r2r (mm0, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
706 movq_m2r (*(ref+9), mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
707 pxor_r2r (mm1, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
708 movq_m2r (*(ref+stride+8), mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
709 movq_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
710 pxor_r2r (mm3, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
711 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
712 pavg_r2r (mm3, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
713 por_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
714 movq_r2r (mm0, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
715 pxor_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
716 pand_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
717 pand_m2r (mask_one, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
718 pavg_r2r (mm2, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
719 psubusb_r2r (mm7, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
720 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
721 movq_r2m (mm0, *(dest+8));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
722 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
723 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
724 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
725
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
726 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
727 const int stride, const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
728 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
729 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
730 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
731 movq_m2r (*(ref+stride+1), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
732 movq_r2r (mm0, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
733 movq_m2r (*(ref+1), mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
734 pxor_r2r (mm1, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
735 movq_m2r (*(ref+stride), mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
736 movq_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
737 pxor_r2r (mm3, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
738 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
739 pavg_r2r (mm3, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
740 por_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
741 movq_r2r (mm0, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
742 pxor_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
743 pand_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
744 pand_m2r (mask_one, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
745 pavg_r2r (mm2, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
746 psubusb_r2r (mm7, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
747 movq_m2r (*dest, mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
748 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
749 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
750 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
751 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
752 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
753 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
754
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
755 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
756 const int stride, const int cpu)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
757 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
758 do {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
759 movq_m2r (*ref, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
760 movq_m2r (*(ref+stride+1), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
761 movq_r2r (mm0, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
762 movq_m2r (*(ref+1), mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
763 pxor_r2r (mm1, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
764 movq_m2r (*(ref+stride), mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
765 movq_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
766 pxor_r2r (mm3, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
767 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
768 pavg_r2r (mm3, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
769 por_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
770 movq_r2r (mm0, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
771 pxor_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
772 pand_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
773 pand_m2r (mask_one, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
774 pavg_r2r (mm2, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
775 psubusb_r2r (mm7, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
776 movq_m2r (*dest, mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
777 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
778 movq_r2m (mm0, *dest);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
779
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
780 movq_m2r (*(ref+8), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
781 movq_m2r (*(ref+stride+9), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
782 movq_r2r (mm0, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
783 movq_m2r (*(ref+9), mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
784 pxor_r2r (mm1, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
785 movq_m2r (*(ref+stride+8), mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
786 movq_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
787 pxor_r2r (mm3, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
788 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
789 pavg_r2r (mm3, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
790 por_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
791 movq_r2r (mm0, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
792 pxor_r2r (mm2, mm6);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
793 pand_r2r (mm6, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
794 pand_m2r (mask_one, mm7);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
795 pavg_r2r (mm2, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
796 psubusb_r2r (mm7, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
797 movq_m2r (*(dest+8), mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
798 pavg_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
799 ref += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
800 movq_r2m (mm0, *(dest+8));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
801 dest += stride;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
802 } while (--height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
803 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
804
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
805 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
806 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
807 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
808 MC_avg1_16 (height, dest, ref, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
809 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
810
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
811 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
812 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
813 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
814 MC_avg1_8 (height, dest, ref, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
815 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
816
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
817 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
818 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
819 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
820 MC_put1_16 (height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
821 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
822
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
823 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
824 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
825 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
826 MC_put1_8 (height, dest, ref, stride);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
827 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
828
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
829 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
830 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
831 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
832 MC_avg2_16 (height, dest, ref, stride, 1, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
833 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
834
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
835 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
836 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
837 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
838 MC_avg2_8 (height, dest, ref, stride, 1, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
839 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
840
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
841 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
842 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
843 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
844 MC_put2_16 (height, dest, ref, stride, 1, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
845 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
846
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
847 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
848 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
849 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
850 MC_put2_8 (height, dest, ref, stride, 1, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
851 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
852
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
853 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
854 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
855 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
856 MC_avg2_16 (height, dest, ref, stride, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
857 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
858
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
859 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
860 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
861 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
862 MC_avg2_8 (height, dest, ref, stride, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
863 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
864
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
865 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
866 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
867 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
868 MC_put2_16 (height, dest, ref, stride, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
869 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
870
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
871 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
872 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
873 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
874 MC_put2_8 (height, dest, ref, stride, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
875 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
876
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
877 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
878 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
879 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
880 MC_avg4_16 (height, dest, ref, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
881 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
882
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
883 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
884 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
885 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
886 MC_avg4_8 (height, dest, ref, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
887 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
888
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
889 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
890 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
891 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
892 MC_put4_16 (height, dest, ref, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
893 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
894
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
895 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
896 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
897 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
898 MC_put4_8 (height, dest, ref, stride, CPU_MMXEXT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
899 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
900
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
901
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
902 MPEG2_MC_EXTERN (mmxext)
1
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 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
907 int stride, int height)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
908 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
909 MC_avg1_16 (height, dest, ref, stride, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
910 }
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_8_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_8 (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_put_o_16_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_put1_16 (height, dest, ref, stride);
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_8_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_8 (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_avg_x_16_3dnow (uint8_t * dest, const uint8_t * ref,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
931 int stride, int height)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
932 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
933 MC_avg2_16 (height, dest, ref, stride, 1, CPU_3DNOW);
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_8_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_8 (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_put_x_16_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_put2_16 (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_8_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_8 (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_avg_y_16_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_avg2_16 (height, dest, ref, stride, stride, 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_8_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_8 (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_put_y_16_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_put2_16 (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_8_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_8 (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_avg_xy_16_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_avg4_16 (height, dest, ref, 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_8_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_8 (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_put_xy_16_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_put4_16 (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_8_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_8 (height, dest, ref, stride, CPU_3DNOW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1000 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1002
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
1003 MPEG2_MC_EXTERN (3dnow)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1004
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1005 #endif