annotate libmpeg2/motion_comp_mmx.c @ 22531:090ec2169aee

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