Mercurial > mplayer.hg
annotate libmpeg2/libmpeg-0.4.1.diff @ 25005:1635b2b31bdd
Add missing call to audio_in_uninit in v4l2 tv driver.
Without it, tv does not start on the second run when using mplayer in slave or idle mode.
Patch by Stanislaw Jesmanowicz stan at jesmanowicz dot com
author | voroshil |
---|---|
date | Tue, 13 Nov 2007 11:34:45 +0000 |
parents | 1769eb14d6e8 |
children | 11181df06389 |
rev | line source |
---|---|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
1 --- include/attributes.h 2006-06-16 20:12:26.000000000 +0200 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
2 +++ libmpeg2/attributes.h 2006-06-16 20:12:50.000000000 +0200 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
3 @@ -25,7 +29,7 @@ |
13147 | 4 #ifdef ATTRIBUTE_ALIGNED_MAX |
5 #define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align))) | |
6 #else | |
7 -#define ATTR_ALIGN(align) | |
8 +#define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((16 < align) ? 16 : align))) | |
9 #endif | |
10 | |
11 #ifdef HAVE_BUILTIN_EXPECT | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
12 --- libmpeg2/cpu_accel.c 2006-06-16 20:12:26.000000000 +0200 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
13 +++ libmpeg2/cpu_accel.c 2006-06-16 20:12:50.000000000 +0200 |
19026 | 14 @@ -22,6 +26,7 @@ |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
15 */ |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
16 |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
17 #include "config.h" |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
18 +#include "cpudetect.h" |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
19 |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
20 #include <inttypes.h> |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
21 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
22 @@ -30,9 +35,17 @@ |
13864 | 23 #include "mpeg2_internal.h" |
24 | |
25 #ifdef ACCEL_DETECT | |
26 -#ifdef ARCH_X86 | |
27 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
28 + |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
29 +/* MPlayer imports libmpeg2 as decoder, which detects MMX / 3DNow! |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
30 + * instructions via assembly. However, it is regarded as duplicaed work |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
31 + * in MPlayer, so that we enforce to use MPlayer's implementation. |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
32 + */ |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
33 +#define USE_MPLAYER_CPUDETECT |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
34 + |
13864 | 35 static inline uint32_t arch_accel (void) |
36 { | |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
37 +#if !defined(USE_MPLAYER_CPUDETECT) |
13864 | 38 uint32_t eax, ebx, ecx, edx; |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
39 int AMD; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
40 uint32_t caps; |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
41 @@ -105,10 +118,24 @@ |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
42 caps |= MPEG2_ACCEL_X86_MMXEXT; |
13864 | 43 |
44 return caps; | |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
45 +#else /* USE_MPLAYER_CPUDETECT: Use MPlayer's cpu capability property */ |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
46 + caps = 0; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
47 + if (gCpuCaps.hasMMX) |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
48 + caps |= MPEG2_ACCEL_X86_MMX; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
49 + if (gCpuCaps.hasSSE2) |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
50 + caps |= MPEG2_ACCEL_X86_SSE2; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
51 + if (gCpuCaps.hasMMX2) |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
52 + caps |= MPEG2_ACCEL_X86_MMXEXT; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
53 + if (gCpuCaps.has3DNow) |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
54 + caps |= MPEG2_ACCEL_X86_3DNOW; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
55 + |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
56 + return caps; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
57 + |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
58 +#endif /* USE_MPLAYER_CPUDETECT */ |
13020 | 59 } |
13864 | 60 -#endif /* ARCH_X86 */ |
61 +#endif /* ARCH_X86 || ARCH_X86_64 */ | |
13020 | 62 |
63 -#if defined(ARCH_PPC) || defined(ARCH_SPARC) | |
64 +#if defined(ARCH_PPC) || (defined(ARCH_SPARC) && defined(HAVE_VIS)) | |
65 #include <signal.h> | |
66 #include <setjmp.h> | |
67 | |
21377 | 68 @@ -166,10 +166,10 @@ |
69 | |
70 canjump = 1; | |
71 | |
72 -#ifdef HAVE_ALTIVEC_H /* gnu */ | |
73 -#define VAND(a,b,c) "vand " #a "," #b "," #c "\n\t" | |
74 -#else /* apple */ | |
75 +#if defined( __APPLE_CC__ ) && defined( __APPLE_ALTIVEC__ ) /* apple */ | |
76 #define VAND(a,b,c) "vand v" #a ",v" #b ",v" #c "\n\t" | |
77 +#else /* gnu */ | |
78 +#define VAND(a,b,c) "vand " #a "," #b "," #c "\n\t" | |
79 #endif | |
80 asm volatile ("mtspr 256, %0\n\t" | |
81 VAND (0, 0, 0) | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
82 @@ -195,6 +222,7 @@ |
12937 | 83 #ifdef ARCH_ALPHA |
84 static inline uint32_t arch_accel (void) | |
85 { | |
86 +#ifdef CAN_COMPILE_ALPHA_MVI | |
87 uint64_t no_mvi; | |
88 | |
89 asm volatile ("amask %1, %0" | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
90 @@ -202,6 +230,9 @@ |
12937 | 91 : "rI" (256)); /* AMASK_MVI */ |
92 return no_mvi ? MPEG2_ACCEL_ALPHA : (MPEG2_ACCEL_ALPHA | | |
93 MPEG2_ACCEL_ALPHA_MVI); | |
94 +#else | |
95 + return MPEG2_ACCEL_ALPHA; | |
96 +#endif | |
97 } | |
98 #endif /* ARCH_ALPHA */ | |
99 #endif /* ACCEL_DETECT */ | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
100 @@ -212,7 +243,7 @@ |
13864 | 101 |
102 accel = 0; | |
103 #ifdef ACCEL_DETECT | |
104 -#if defined (ARCH_X86) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC) | |
105 +#if defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC) | |
106 accel = arch_accel (); | |
107 #endif | |
108 #endif | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
109 --- libmpeg2/cpu_state.c 2006-06-16 20:12:26.000000000 +0200 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
110 +++ libmpeg2/cpu_state.c 2006-06-16 20:12:50.000000000 +0200 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
111 @@ -29,14 +33,14 @@ |
13864 | 112 #include "mpeg2.h" |
113 #include "attributes.h" | |
114 #include "mpeg2_internal.h" | |
115 -#ifdef ARCH_X86 | |
116 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
117 #include "mmx.h" | |
118 #endif | |
119 | |
120 void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL; | |
121 void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL; | |
122 | |
123 -#ifdef ARCH_X86 | |
124 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
125 static void state_restore_mmx (cpu_state_t * state) | |
126 { | |
127 emms (); | |
21571 | 128 @@ -48,18 +48,18 @@ |
129 #endif | |
130 | |
131 -#ifdef ARCH_PPC | |
132 +#if defined(ARCH_PPC) && defined(HAVE_ALTIVEC) | |
133 -#ifdef HAVE_ALTIVEC_H /* gnu */ | |
134 -#define LI(a,b) "li " #a "," #b "\n\t" | |
135 -#define STVX0(a,b,c) "stvx " #a ",0," #c "\n\t" | |
136 -#define STVX(a,b,c) "stvx " #a "," #b "," #c "\n\t" | |
137 -#define LVX0(a,b,c) "lvx " #a ",0," #c "\n\t" | |
138 -#define LVX(a,b,c) "lvx " #a "," #b "," #c "\n\t" | |
139 -#else /* apple */ | |
140 +#if defined( __APPLE_CC__ ) && defined( __APPLE_ALTIVEC__ ) /* apple */ | |
141 #define LI(a,b) "li r" #a "," #b "\n\t" | |
142 #define STVX0(a,b,c) "stvx v" #a ",0,r" #c "\n\t" | |
143 #define STVX(a,b,c) "stvx v" #a ",r" #b ",r" #c "\n\t" | |
144 #define LVX0(a,b,c) "lvx v" #a ",0,r" #c "\n\t" | |
145 #define LVX(a,b,c) "lvx v" #a ",r" #b ",r" #c "\n\t" | |
146 +#else /* gnu */ | |
147 +#define LI(a,b) "li " #a "," #b "\n\t" | |
148 +#define STVX0(a,b,c) "stvx " #a ",0," #c "\n\t" | |
149 +#define STVX(a,b,c) "stvx " #a "," #b "," #c "\n\t" | |
150 +#define LVX0(a,b,c) "lvx " #a ",0," #c "\n\t" | |
151 +#define LVX(a,b,c) "lvx " #a "," #b "," #c "\n\t" | |
152 #endif | |
153 | |
154 static void state_save_altivec (cpu_state_t * state) | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
155 @@ -115,12 +119,12 @@ |
13864 | 156 |
157 void mpeg2_cpu_state_init (uint32_t accel) | |
158 { | |
159 -#ifdef ARCH_X86 | |
160 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
161 if (accel & MPEG2_ACCEL_X86_MMX) { | |
12937 | 162 mpeg2_cpu_state_restore = state_restore_mmx; |
163 } | |
164 #endif | |
165 -#ifdef ARCH_PPC | |
166 +#if defined(ARCH_PPC) && defined(HAVE_ALTIVEC) | |
167 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) { | |
168 mpeg2_cpu_state_save = state_save_altivec; | |
169 mpeg2_cpu_state_restore = state_restore_altivec; | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
170 --- libmpeg2/decode.c 2006-06-16 20:12:26.000000000 +0200 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
171 +++ libmpeg2/decode.c 2006-06-16 20:12:50.000000000 +0200 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
172 @@ -351,6 +355,15 @@ |
12937 | 173 fbuf->buf[1] = buf[1]; |
174 fbuf->buf[2] = buf[2]; | |
175 fbuf->id = id; | |
176 + // HACK! FIXME! At first I frame, copy pointers to prediction frame too! | |
177 + if (mpeg2dec->custom_fbuf && !mpeg2dec->fbuf[1]->buf[0]){ | |
178 + mpeg2dec->fbuf[1]->buf[0]=buf[0]; | |
179 + mpeg2dec->fbuf[1]->buf[1]=buf[1]; | |
180 + mpeg2dec->fbuf[1]->buf[2]=buf[2]; | |
181 + mpeg2dec->fbuf[1]->id=NULL; | |
182 + } | |
183 +// printf("libmpeg2: FBUF 0:%p 1:%p 2:%p\n", | |
184 +// mpeg2dec->fbuf[0]->buf[0],mpeg2dec->fbuf[1]->buf[0],mpeg2dec->fbuf[2]->buf[0]); | |
185 } | |
186 | |
187 void mpeg2_custom_fbuf (mpeg2dec_t * mpeg2dec, int custom_fbuf) | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
188 --- libmpeg2/header.c 2006-06-16 20:12:26.000000000 +0200 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
189 +++ libmpeg2/header.c 2006-06-16 20:12:50.000000000 +0200 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
190 @@ -100,6 +104,9 @@ |
12937 | 191 mpeg2dec->decoder.convert = NULL; |
192 mpeg2dec->decoder.convert_id = NULL; | |
193 mpeg2dec->picture = mpeg2dec->pictures; | |
194 + memset(&mpeg2dec->fbuf_alloc[0].fbuf, 0, sizeof(mpeg2_fbuf_t)); | |
195 + memset(&mpeg2dec->fbuf_alloc[1].fbuf, 0, sizeof(mpeg2_fbuf_t)); | |
196 + memset(&mpeg2dec->fbuf_alloc[2].fbuf, 0, sizeof(mpeg2_fbuf_t)); | |
197 mpeg2dec->fbuf[0] = &mpeg2dec->fbuf_alloc[0].fbuf; | |
198 mpeg2dec->fbuf[1] = &mpeg2dec->fbuf_alloc[1].fbuf; | |
199 mpeg2dec->fbuf[2] = &mpeg2dec->fbuf_alloc[2].fbuf; | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
200 @@ -551,6 +558,7 @@ |
12937 | 201 if (!(mpeg2dec->sequence.flags & SEQ_FLAG_PROGRESSIVE_SEQUENCE)) { |
202 picture->nb_fields = (buffer[3] & 2) ? 3 : 2; | |
203 flags |= (buffer[3] & 128) ? PIC_FLAG_TOP_FIELD_FIRST : 0; | |
204 + flags |= (buffer[3] & 2) ? PIC_FLAG_REPEAT_FIRST_FIELD : 0; | |
205 } else | |
206 picture->nb_fields = (buffer[3]&2) ? ((buffer[3]&128) ? 6 : 4) : 2; | |
207 break; | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
208 @@ -799,6 +807,7 @@ |
12937 | 209 mpeg2dec->scaled[index] = mpeg2dec->q_scale_type; |
210 for (i = 0; i < 32; i++) { | |
211 k = mpeg2dec->q_scale_type ? non_linear_scale[i] : (i << 1); | |
13147 | 212 + decoder->quantizer_scales[i] = k; |
12937 | 213 for (j = 0; j < 64; j++) |
214 decoder->quantizer_prescale[index][i][j] = | |
215 k * mpeg2dec->quantizer_matrix[index][j]; | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
216 --- libmpeg2/idct.c 2006-06-16 20:12:26.000000000 +0200 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
217 +++ libmpeg2/idct.c 2006-06-16 20:12:50.000000000 +0200 |
19259 | 218 @@ -239,12 +239,15 @@ |
13864 | 219 |
220 void mpeg2_idct_init (uint32_t accel) | |
221 { | |
222 -#ifdef ARCH_X86 | |
19259 | 223 +#ifdef HAVE_MMX2 |
13864 | 224 if (accel & MPEG2_ACCEL_X86_MMXEXT) { |
225 mpeg2_idct_copy = mpeg2_idct_copy_mmxext; | |
226 mpeg2_idct_add = mpeg2_idct_add_mmxext; | |
19259 | 227 mpeg2_idct_mmx_init (); |
228 - } else if (accel & MPEG2_ACCEL_X86_MMX) { | |
229 + } else | |
230 +#endif | |
231 +#ifdef HAVE_MMX | |
232 + if (accel & MPEG2_ACCEL_X86_MMX) { | |
233 mpeg2_idct_copy = mpeg2_idct_copy_mmx; | |
234 mpeg2_idct_add = mpeg2_idct_add_mmx; | |
235 mpeg2_idct_mmx_init (); | |
236 @@ -254,11 +261,14 @@ | |
13864 | 237 } else |
238 #endif | |
239 #ifdef ARCH_ALPHA | |
240 +#ifdef CAN_COMPILE_ALPHA_MVI | |
241 if (accel & MPEG2_ACCEL_ALPHA_MVI) { | |
242 mpeg2_idct_copy = mpeg2_idct_copy_mvi; | |
243 mpeg2_idct_add = mpeg2_idct_add_mvi; | |
244 mpeg2_idct_alpha_init (); | |
245 - } else if (accel & MPEG2_ACCEL_ALPHA) { | |
246 + } else | |
247 +#endif | |
248 + if (accel & MPEG2_ACCEL_ALPHA) { | |
249 int i; | |
250 | |
251 mpeg2_idct_copy = mpeg2_idct_copy_alpha; | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
252 --- libmpeg2/idct_alpha.c 2006-06-16 20:12:26.000000000 +0200 |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
253 +++ libmpeg2/idct_alpha.c 2006-06-16 20:12:50.000000000 +0200 |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
254 @@ -157,6 +161,7 @@ |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
255 block[8*7] = (a0 - b0) >> 17; |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
256 } |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
257 |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
258 +#ifdef CAN_COMPILE_ALPHA_MVI |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
259 void mpeg2_idct_copy_mvi (int16_t * block, uint8_t * dest, const int stride) |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
260 { |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
261 uint64_t clampmask; |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
262 @@ -289,6 +294,7 @@ |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
263 stq (p7, dest + 7 * stride); |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
264 } |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
265 } |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
266 +#endif |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
267 |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
268 void mpeg2_idct_copy_alpha (int16_t * block, uint8_t * dest, const int stride) |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
269 { |
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
270 --- libmpeg2/idct_mmx.c 2006-06-16 20:12:26.000000000 +0200 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
271 +++ libmpeg2/idct_mmx.c 2006-06-16 20:12:50.000000000 +0200 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
272 @@ -23,7 +27,7 @@ |
13864 | 273 |
274 #include "config.h" | |
12937 | 275 |
13864 | 276 -#ifdef ARCH_X86 |
277 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
278 | |
279 #include <inttypes.h> | |
12937 | 280 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
281 --- libmpeg2/motion_comp.c 2006-06-16 20:12:26.000000000 +0200 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
282 +++ libmpeg2/motion_comp.c 2006-06-16 20:12:50.000000000 +0200 |
19259 | 283 @@ -37,16 +37,22 @@ |
13864 | 284 |
285 void mpeg2_mc_init (uint32_t accel) | |
12937 | 286 { |
13864 | 287 -#ifdef ARCH_X86 |
19259 | 288 +#ifdef HAVE_MMX2 |
13864 | 289 if (accel & MPEG2_ACCEL_X86_MMXEXT) |
290 mpeg2_mc = mpeg2_mc_mmxext; | |
19259 | 291 - else if (accel & MPEG2_ACCEL_X86_3DNOW) |
292 + else | |
293 +#endif | |
294 +#ifdef HAVE_3DNOW | |
295 + if (accel & MPEG2_ACCEL_X86_3DNOW) | |
296 mpeg2_mc = mpeg2_mc_3dnow; | |
297 - else if (accel & MPEG2_ACCEL_X86_MMX) | |
298 + else | |
299 +#endif | |
300 +#ifdef HAVE_MMX | |
301 + if (accel & MPEG2_ACCEL_X86_MMX) | |
14730 | 302 mpeg2_mc = mpeg2_mc_mmx; |
21526 | 303 else |
12937 | 304 #endif |
14730 | 305 -#ifdef ARCH_PPC |
306 +#if defined(ARCH_PPC) && defined(HAVE_ALTIVEC) | |
12937 | 307 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) |
308 mpeg2_mc = mpeg2_mc_altivec; | |
309 else | |
19259 | 310 @@ -52,7 +62,7 @@ |
12937 | 311 mpeg2_mc = mpeg2_mc_alpha; |
13020 | 312 else |
313 #endif | |
14730 | 314 -#ifdef ARCH_SPARC |
315 +#if defined(ARCH_SPARC) && defined(HAVE_VIS) | |
13020 | 316 if (accel & MPEG2_ACCEL_SPARC_VIS) |
317 mpeg2_mc = mpeg2_mc_vis; | |
318 else | |
23236
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
319 @@ -67,6 +67,16 @@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
320 mpeg2_mc = mpeg2_mc_vis; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
321 else |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
322 #endif |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
323 +#ifdef ARCH_ARM |
23241
e42491f6fa84
add MPlayer's local changes introduced in r23258
gpoirier
parents:
23236
diff
changeset
|
324 + if (1 /*accel & MPEG2_ACCEL_ARM*/) { |
23236
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
325 +#ifdef HAVE_IWMMXT |
23241
e42491f6fa84
add MPlayer's local changes introduced in r23258
gpoirier
parents:
23236
diff
changeset
|
326 + if (1 /*accel & MPEG2_ACCEL_ARM_IWMMXT*/) |
23236
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
327 + mpeg2_mc = mpeg2_mc_iwmmxt; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
328 + else |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
329 +#endif |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
330 + mpeg2_mc = mpeg2_mc_arm; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
331 + } else |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
332 +#endif |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
333 mpeg2_mc = mpeg2_mc_c; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
334 } |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
335 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
336 --- libmpeg2/motion_comp_mmx.c 2006-06-16 20:12:26.000000000 +0200 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
337 +++ libmpeg2/motion_comp_mmx.c 2006-06-16 20:12:50.000000000 +0200 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
338 @@ -23,7 +27,7 @@ |
13864 | 339 |
340 #include "config.h" | |
341 | |
342 -#ifdef ARCH_X86 | |
343 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
344 | |
345 #include <inttypes.h> | |
346 | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
347 --- include/mpeg2.h 2006-06-16 20:12:26.000000000 +0200 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
348 +++ libmpeg2/mpeg2.h 2006-06-16 20:12:50.000000000 +0200 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
349 @@ -82,6 +86,7 @@ |
13147 | 350 #define PIC_FLAG_COMPOSITE_DISPLAY 32 |
351 #define PIC_FLAG_SKIP 64 | |
352 #define PIC_FLAG_TAGS 128 | |
353 +#define PIC_FLAG_REPEAT_FIRST_FIELD 256 | |
354 #define PIC_MASK_COMPOSITE_DISPLAY 0xfffff000 | |
355 | |
356 typedef struct mpeg2_picture_s { | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
357 @@ -154,6 +159,7 @@ |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
358 #define MPEG2_ACCEL_X86_MMX 1 |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
359 #define MPEG2_ACCEL_X86_3DNOW 2 |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
360 #define MPEG2_ACCEL_X86_MMXEXT 4 |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
361 +#define MPEG2_ACCEL_X86_SSE2 8 |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
362 #define MPEG2_ACCEL_PPC_ALTIVEC 1 |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
363 #define MPEG2_ACCEL_ALPHA 1 |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
364 #define MPEG2_ACCEL_ALPHA_MVI 2 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
365 --- libmpeg2/mpeg2_internal.h 2006-06-16 20:12:26.000000000 +0200 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
366 +++ libmpeg2/mpeg2_internal.h 2006-06-16 20:12:50.000000000 +0200 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
367 @@ -144,6 +148,12 @@ |
12937 | 368 int second_field; |
369 | |
370 int mpeg1; | |
371 + | |
372 + /* for MPlayer: */ | |
13147 | 373 + int quantizer_scales[32]; |
12937 | 374 + int quantizer_scale; |
375 + char* quant_store; | |
376 + int quant_stride; | |
377 }; | |
378 | |
379 typedef struct { | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
380 @@ -214,6 +224,10 @@ |
13147 | 381 int8_t q_scale_type, scaled[4]; |
382 uint8_t quantizer_matrix[4][64]; | |
383 uint8_t new_quantizer_matrix[4][64]; | |
384 + | |
385 + /* for MPlayer: */ | |
386 + unsigned char *pending_buffer; | |
387 + int pending_length; | |
388 }; | |
389 | |
390 typedef struct { | |
23236
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
391 @@ -312,3 +312,5 @@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
392 extern mpeg2_mc_t mpeg2_mc_altivec; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
393 extern mpeg2_mc_t mpeg2_mc_alpha; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
394 extern mpeg2_mc_t mpeg2_mc_vis; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
395 +extern mpeg2_mc_t mpeg2_mc_arm; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
396 +extern mpeg2_mc_t mpeg2_mc_iwmmxt; |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
397 --- libmpeg2/slice.c 2006-06-16 20:12:26.000000000 +0200 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
398 +++ libmpeg2/slice.c 2006-06-16 20:12:50.000000000 +0200 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
399 @@ -142,6 +146,7 @@ |
13147 | 400 |
401 quantizer_scale_code = UBITS (bit_buf, 5); | |
402 DUMPBITS (bit_buf, bits, 5); | |
403 + decoder->quantizer_scale = decoder->quantizer_scales[quantizer_scale_code]; | |
404 | |
405 decoder->quantizer_matrix[0] = | |
406 decoder->quantizer_prescale[0][quantizer_scale_code]; | |
20640 | 407 @@ -1568,6 +1569,18 @@ |
12937 | 408 |
409 #define NEXT_MACROBLOCK \ | |
410 do { \ | |
20640 | 411 + if(decoder->quant_store) { \ |
412 + if (decoder->picture_structure == TOP_FIELD) \ | |
413 + decoder->quant_store[2*decoder->quant_stride*(decoder->v_offset>>4) \ | |
414 + +(decoder->offset>>4)] = decoder->quantizer_scale; \ | |
415 + else if (decoder->picture_structure == BOTTOM_FIELD) \ | |
416 + decoder->quant_store[2*decoder->quant_stride*(decoder->v_offset>>4) \ | |
417 + + decoder->quant_stride \ | |
418 + +(decoder->offset>>4)] = decoder->quantizer_scale; \ | |
419 + else \ | |
12937 | 420 + decoder->quant_store[decoder->quant_stride*(decoder->v_offset>>4) \ |
421 + +(decoder->offset>>4)] = decoder->quantizer_scale; \ | |
20640 | 422 + } \ |
12937 | 423 decoder->offset += 16; \ |
424 if (decoder->offset == decoder->width) { \ | |
425 do { /* just so we can use the break statement */ \ | |
21923
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
426 @@ -1604,6 +1604,12 @@ |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
427 } \ |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
428 } while (0) |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
429 |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
430 +static void motion_dummy (mpeg2_decoder_t * const decoder, |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
431 + motion_t * const motion, |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
432 + mpeg2_mc_fct * const * const table) |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
433 +{ |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
434 +} |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
435 + |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
436 void mpeg2_init_fbuf (mpeg2_decoder_t * decoder, uint8_t * current_fbuf[3], |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
437 uint8_t * forward_fbuf[3], uint8_t * backward_fbuf[3]) |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
438 { |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
439 @@ -1661,7 +1667,9 @@ |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
440 |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
441 if (decoder->mpeg1) { |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
442 decoder->motion_parser[0] = motion_zero_420; |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
443 + decoder->motion_parser[MC_FIELD] = motion_dummy; |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
444 decoder->motion_parser[MC_FRAME] = motion_mp1; |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
445 + decoder->motion_parser[MC_DMV] = motion_dummy; |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
446 decoder->motion_parser[4] = motion_reuse_420; |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
447 } else if (decoder->picture_structure == FRAME_PICTURE) { |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
448 if (decoder->chroma_format == 0) { |
21534 | 449 --- libmpeg2/idct.c 2006-06-16 20:12:26.000000000 +0200 |
450 +++ libmpeg2/idct.c 2006-06-16 20:12:50.000000000 +0200 | |
451 @@ -253,7 +253,7 @@ | |
452 mpeg2_idct_mmx_init (); | |
453 } else | |
454 #endif | |
455 -#ifdef ARCH_PPC | |
456 +#if defined(ARCH_PPC) && defined(HAVE_ALTIVEC) | |
457 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) { | |
458 mpeg2_idct_copy = mpeg2_idct_copy_altivec; | |
459 mpeg2_idct_add = mpeg2_idct_add_altivec; | |
21571 | 460 --- libmpeg2/idct_altivec.c 2004/08/02 11:26:43 12933 |
461 +++ libmpeg2/idct_altivec.c 2005/05/15 20:11:34 15484 | |
462 @@ -41,7 +41,7 @@ | |
463 typedef vector signed int vector_s32_t; | |
464 typedef vector unsigned int vector_u32_t; | |
465 | |
466 -#if defined(HAVE_ALTIVEC_H) && (__GNUC__ * 100 + __GNUC_MINOR__ < 303) | |
467 +#if defined( HAVE_ALTIVEC_H ) && !defined( __APPLE_ALTIVEC__ ) && (__GNUC__ * 100 + __GNUC_MINOR__ < 303) | |
468 /* work around gcc <3.3 vec_mergel bug */ | |
469 static inline vector_s16_t my_vec_mergel (vector_s16_t const A, | |
470 vector_s16_t const B) | |
471 @@ -56,10 +56,10 @@ | |
472 #define vec_mergel my_vec_mergel | |
473 #endif | |
474 | |
475 -#ifdef HAVE_ALTIVEC_H /* gnu */ | |
476 -#define VEC_S16(a,b,c,d,e,f,g,h) {a, b, c, d, e, f, g, h} | |
477 -#else /* apple */ | |
478 +#if defined( __APPLE_CC__ ) && defined( __APPLE_ALTIVEC__ ) /* apple */ | |
479 #define VEC_S16(a,b,c,d,e,f,g,h) (vector_s16_t) (a, b, c, d, e, f, g, h) | |
480 +#else /* gnu */ | |
481 +#define VEC_S16(a,b,c,d,e,f,g,h) {a, b, c, d, e, f, g, h} | |
482 #endif | |
483 | |
484 static const vector_s16_t constants ATTR_ALIGN(16) = | |
23236
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
485 Index: libmpeg2/motion_comp_arm.c |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
486 =================================================================== |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
487 --- libmpeg2/motion_comp_arm.c (revision 0) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
488 +++ libmpeg2/motion_comp_arm.c (revision 0) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
489 @@ -0,0 +1,187 @@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
490 +/* |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
491 + * motion_comp_arm.c |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
492 + * Copyright (C) 2004 AGAWA Koji <i (AT) atty (DOT) jp> |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
493 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
494 + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
495 + * See http://libmpeg2.sourceforge.net/ for updates. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
496 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
497 + * mpeg2dec is free software; you can redistribute it and/or modify |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
498 + * it under the terms of the GNU General Public License as published by |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
499 + * the Free Software Foundation; either version 2 of the License, or |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
500 + * (at your option) any later version. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
501 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
502 + * mpeg2dec is distributed in the hope that it will be useful, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
503 + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
504 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
505 + * GNU General Public License for more details. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
506 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
507 + * You should have received a copy of the GNU General Public License |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
508 + * along with this program; if not, write to the Free Software |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
509 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
510 + */ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
511 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
512 +#include "config.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
513 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
514 +#ifdef ARCH_ARM |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
515 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
516 +#include <inttypes.h> |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
517 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
518 +#include "mpeg2.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
519 +#include "attributes.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
520 +#include "mpeg2_internal.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
521 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
522 +#define avg2(a,b) ((a+b+1)>>1) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
523 +#define avg4(a,b,c,d) ((a+b+c+d+2)>>2) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
524 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
525 +#define predict_o(i) (ref[i]) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
526 +#define predict_x(i) (avg2 (ref[i], ref[i+1])) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
527 +#define predict_y(i) (avg2 (ref[i], (ref+stride)[i])) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
528 +#define predict_xy(i) (avg4 (ref[i], ref[i+1], \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
529 + (ref+stride)[i], (ref+stride)[i+1])) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
530 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
531 +#define put(predictor,i) dest[i] = predictor (i) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
532 +#define avg(predictor,i) dest[i] = avg2 (predictor (i), dest[i]) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
533 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
534 +/* mc function template */ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
535 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
536 +#define MC_FUNC(op,xy) \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
537 +static void inline MC_##op##_##xy##_16_c (uint8_t * dest, const uint8_t * ref, \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
538 + const int stride, int height) \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
539 +{ \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
540 + do { \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
541 + op (predict_##xy, 0); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
542 + op (predict_##xy, 1); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
543 + op (predict_##xy, 2); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
544 + op (predict_##xy, 3); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
545 + op (predict_##xy, 4); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
546 + op (predict_##xy, 5); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
547 + op (predict_##xy, 6); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
548 + op (predict_##xy, 7); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
549 + op (predict_##xy, 8); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
550 + op (predict_##xy, 9); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
551 + op (predict_##xy, 10); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
552 + op (predict_##xy, 11); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
553 + op (predict_##xy, 12); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
554 + op (predict_##xy, 13); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
555 + op (predict_##xy, 14); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
556 + op (predict_##xy, 15); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
557 + ref += stride; \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
558 + dest += stride; \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
559 + } while (--height); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
560 +} \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
561 +static void MC_##op##_##xy##_8_c (uint8_t * dest, const uint8_t * ref, \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
562 + const int stride, int height) \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
563 +{ \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
564 + do { \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
565 + op (predict_##xy, 0); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
566 + op (predict_##xy, 1); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
567 + op (predict_##xy, 2); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
568 + op (predict_##xy, 3); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
569 + op (predict_##xy, 4); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
570 + op (predict_##xy, 5); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
571 + op (predict_##xy, 6); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
572 + op (predict_##xy, 7); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
573 + ref += stride; \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
574 + dest += stride; \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
575 + } while (--height); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
576 +} \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
577 +/* definitions of the actual mc functions */ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
578 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
579 +MC_FUNC (put,o) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
580 +MC_FUNC (avg,o) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
581 +MC_FUNC (put,x) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
582 +MC_FUNC (avg,x) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
583 +MC_FUNC (put,y) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
584 +MC_FUNC (avg,y) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
585 +MC_FUNC (put,xy) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
586 +MC_FUNC (avg,xy) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
587 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
588 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
589 +extern void MC_put_o_16_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
590 + int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
591 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
592 +extern void MC_put_x_16_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
593 + int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
594 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
595 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
596 +static void MC_put_y_16_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
597 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
598 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
599 + MC_put_y_16_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
600 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
601 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
602 +static void MC_put_xy_16_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
603 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
604 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
605 + MC_put_xy_16_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
606 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
607 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
608 +extern void MC_put_o_8_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
609 + int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
610 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
611 +extern void MC_put_x_8_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
612 + int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
613 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
614 +static void MC_put_y_8_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
615 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
616 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
617 + MC_put_y_8_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
618 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
619 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
620 +static void MC_put_xy_8_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
621 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
622 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
623 + MC_put_xy_8_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
624 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
625 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
626 +static void MC_avg_o_16_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
627 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
628 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
629 + MC_avg_o_16_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
630 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
631 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
632 +static void MC_avg_x_16_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
633 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
634 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
635 + MC_avg_x_16_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
636 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
637 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
638 +static void MC_avg_y_16_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
639 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
640 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
641 + MC_avg_y_16_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
642 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
643 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
644 +static void MC_avg_xy_16_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
645 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
646 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
647 + MC_avg_xy_16_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
648 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
649 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
650 +static void MC_avg_o_8_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
651 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
652 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
653 + MC_avg_o_8_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
654 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
655 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
656 +static void MC_avg_x_8_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
657 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
658 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
659 + MC_avg_x_8_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
660 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
661 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
662 +static void MC_avg_y_8_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
663 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
664 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
665 + MC_avg_y_8_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
666 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
667 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
668 +static void MC_avg_xy_8_arm (uint8_t * dest, const uint8_t * ref, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
669 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
670 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
671 + MC_avg_xy_8_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
672 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
673 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
674 +MPEG2_MC_EXTERN (arm) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
675 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
676 +#endif |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
677 Index: libmpeg2/motion_comp_arm_s.S |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
678 =================================================================== |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
679 --- libmpeg2/motion_comp_arm_s.S (revision 0) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
680 +++ libmpeg2/motion_comp_arm_s.S (revision 0) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
681 @@ -0,0 +1,322 @@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
682 +@ motion_comp_arm_s.S |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
683 +@ Copyright (C) 2004 AGAWA Koji <i (AT) atty (DOT) jp> |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
684 +@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
685 +@ This file is part of mpeg2dec, a free MPEG-2 video stream decoder. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
686 +@ See http://libmpeg2.sourceforge.net/ for updates. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
687 +@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
688 +@ mpeg2dec is free software; you can redistribute it and/or modify |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
689 +@ it under the terms of the GNU General Public License as published by |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
690 +@ the Free Software Foundation; either version 2 of the License, or |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
691 +@ (at your option) any later version. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
692 +@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
693 +@ mpeg2dec is distributed in the hope that it will be useful, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
694 +@ but WITHOUT ANY WARRANTY; without even the implied warranty of |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
695 +@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
696 +@ GNU General Public License for more details. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
697 +@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
698 +@ You should have received a copy of the GNU General Public License |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
699 +@ along with this program; if not, write to the Free Software |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
700 +@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
701 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
702 + .text |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
703 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
704 +@ ---------------------------------------------------------------- |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
705 + .align |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
706 + .global MC_put_o_16_arm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
707 +MC_put_o_16_arm: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
708 + @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
709 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
710 + stmfd sp!, {r4-r11, lr} @ R14 is also called LR |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
711 + and r4, r1, #3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
712 + adr r5, MC_put_o_16_arm_align_jt |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
713 + add r5, r5, r4, lsl #2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
714 + ldr pc, [r5] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
715 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
716 +MC_put_o_16_arm_align0: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
717 + ldmia r1, {r4-r7} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
718 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
719 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
720 + stmia r0, {r4-r7} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
721 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
722 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
723 + bne MC_put_o_16_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
724 + ldmfd sp!, {r4-r11, pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
725 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
726 +.macro PROC shift |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
727 + ldmia r1, {r4-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
728 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
729 + mov r9, r4, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
730 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
731 + mov r10, r5, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
732 + orr r9, r9, r5, lsl #(32-\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
733 + mov r11, r6, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
734 + orr r10, r10, r6, lsl #(32-\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
735 + mov r12, r7, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
736 + orr r11, r11, r7, lsl #(32-\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
737 + orr r12, r12, r8, lsl #(32-\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
738 + stmia r0, {r9-r12} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
739 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
740 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
741 +.endm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
742 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
743 +MC_put_o_16_arm_align1: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
744 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
745 +1: PROC(8) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
746 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
747 + ldmfd sp!, {r4-r11, pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
748 +MC_put_o_16_arm_align2: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
749 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
750 +1: PROC(16) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
751 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
752 + ldmfd sp!, {r4-r11, pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
753 +MC_put_o_16_arm_align3: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
754 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
755 +1: PROC(24) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
756 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
757 + ldmfd sp!, {r4-r11, pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
758 +MC_put_o_16_arm_align_jt: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
759 + .word MC_put_o_16_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
760 + .word MC_put_o_16_arm_align1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
761 + .word MC_put_o_16_arm_align2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
762 + .word MC_put_o_16_arm_align3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
763 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
764 +@ ---------------------------------------------------------------- |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
765 + .align |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
766 + .global MC_put_o_8_arm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
767 +MC_put_o_8_arm: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
768 + @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
769 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
770 + stmfd sp!, {r4-r10, lr} @ R14 is also called LR |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
771 + and r4, r1, #3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
772 + adr r5, MC_put_o_8_arm_align_jt |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
773 + add r5, r5, r4, lsl #2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
774 + ldr pc, [r5] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
775 +MC_put_o_8_arm_align0: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
776 + ldmia r1, {r4-r5} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
777 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
778 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
779 + stmia r0, {r4-r5} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
780 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
781 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
782 + bne MC_put_o_8_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
783 + ldmfd sp!, {r4-r10, pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
784 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
785 +.macro PROC8 shift |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
786 + ldmia r1, {r4-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
787 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
788 + mov r9, r4, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
789 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
790 + mov r10, r5, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
791 + orr r9, r9, r5, lsl #(32-\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
792 + orr r10, r10, r6, lsl #(32-\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
793 + stmia r0, {r9-r10} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
794 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
795 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
796 +.endm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
797 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
798 +MC_put_o_8_arm_align1: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
799 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
800 +1: PROC8(8) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
801 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
802 + ldmfd sp!, {r4-r10, pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
803 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
804 +MC_put_o_8_arm_align2: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
805 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
806 +1: PROC8(16) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
807 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
808 + ldmfd sp!, {r4-r10, pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
809 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
810 +MC_put_o_8_arm_align3: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
811 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
812 +1: PROC8(24) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
813 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
814 + ldmfd sp!, {r4-r10, pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
815 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
816 +MC_put_o_8_arm_align_jt: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
817 + .word MC_put_o_8_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
818 + .word MC_put_o_8_arm_align1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
819 + .word MC_put_o_8_arm_align2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
820 + .word MC_put_o_8_arm_align3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
821 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
822 +@ ---------------------------------------------------------------- |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
823 +.macro AVG_PW rW1, rW2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
824 + mov \rW2, \rW2, lsl #24 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
825 + orr \rW2, \rW2, \rW1, lsr #8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
826 + eor r9, \rW1, \rW2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
827 + and \rW2, \rW1, \rW2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
828 + and r10, r9, r12 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
829 + add \rW2, \rW2, r10, lsr #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
830 + and r10, r9, r11 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
831 + add \rW2, \rW2, r10 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
832 +.endm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
833 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
834 + .align |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
835 + .global MC_put_x_16_arm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
836 +MC_put_x_16_arm: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
837 + @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
838 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
839 + stmfd sp!, {r4-r11,lr} @ R14 is also called LR |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
840 + and r4, r1, #3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
841 + adr r5, MC_put_x_16_arm_align_jt |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
842 + ldr r11, [r5] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
843 + mvn r12, r11 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
844 + add r5, r5, r4, lsl #2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
845 + ldr pc, [r5, #4] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
846 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
847 +.macro ADJ_ALIGN_QW shift, R0, R1, R2, R3, R4 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
848 + mov \R0, \R0, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
849 + orr \R0, \R0, \R1, lsl #(32 - \shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
850 + mov \R1, \R1, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
851 + orr \R1, \R1, \R2, lsl #(32 - \shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
852 + mov \R2, \R2, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
853 + orr \R2, \R2, \R3, lsl #(32 - \shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
854 + mov \R3, \R3, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
855 + orr \R3, \R3, \R4, lsl #(32 - \shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
856 + mov \R4, \R4, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
857 +@ and \R4, \R4, #0xFF |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
858 +.endm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
859 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
860 +MC_put_x_16_arm_align0: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
861 + ldmia r1, {r4-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
862 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
863 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
864 + AVG_PW r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
865 + AVG_PW r6, r7 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
866 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
867 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
868 + stmia r0, {r5-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
869 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
870 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
871 + bne MC_put_x_16_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
872 + ldmfd sp!, {r4-r11,pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
873 +MC_put_x_16_arm_align1: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
874 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
875 +1: ldmia r1, {r4-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
876 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
877 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
878 + ADJ_ALIGN_QW 8, r4, r5, r6, r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
879 + AVG_PW r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
880 + AVG_PW r6, r7 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
881 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
882 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
883 + stmia r0, {r5-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
884 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
885 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
886 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
887 + ldmfd sp!, {r4-r11,pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
888 +MC_put_x_16_arm_align2: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
889 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
890 +1: ldmia r1, {r4-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
891 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
892 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
893 + ADJ_ALIGN_QW 16, r4, r5, r6, r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
894 + AVG_PW r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
895 + AVG_PW r6, r7 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
896 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
897 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
898 + stmia r0, {r5-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
899 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
900 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
901 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
902 + ldmfd sp!, {r4-r11,pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
903 +MC_put_x_16_arm_align3: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
904 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
905 +1: ldmia r1, {r4-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
906 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
907 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
908 + ADJ_ALIGN_QW 24, r4, r5, r6, r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
909 + AVG_PW r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
910 + AVG_PW r6, r7 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
911 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
912 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
913 + stmia r0, {r5-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
914 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
915 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
916 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
917 + ldmfd sp!, {r4-r11,pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
918 +MC_put_x_16_arm_align_jt: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
919 + .word 0x01010101 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
920 + .word MC_put_x_16_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
921 + .word MC_put_x_16_arm_align1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
922 + .word MC_put_x_16_arm_align2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
923 + .word MC_put_x_16_arm_align3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
924 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
925 +@ ---------------------------------------------------------------- |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
926 + .align |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
927 + .global MC_put_x_8_arm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
928 +MC_put_x_8_arm: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
929 + @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
930 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
931 + stmfd sp!, {r4-r11,lr} @ R14 is also called LR |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
932 + and r4, r1, #3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
933 + adr r5, MC_put_x_8_arm_align_jt |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
934 + ldr r11, [r5] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
935 + mvn r12, r11 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
936 + add r5, r5, r4, lsl #2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
937 + ldr pc, [r5, #4] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
938 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
939 +.macro ADJ_ALIGN_DW shift, R0, R1, R2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
940 + mov \R0, \R0, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
941 + orr \R0, \R0, \R1, lsl #(32 - \shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
942 + mov \R1, \R1, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
943 + orr \R1, \R1, \R2, lsl #(32 - \shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
944 + mov \R2, \R2, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
945 +@ and \R4, \R4, #0xFF |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
946 +.endm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
947 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
948 +MC_put_x_8_arm_align0: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
949 + ldmia r1, {r4-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
950 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
951 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
952 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
953 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
954 + stmia r0, {r5-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
955 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
956 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
957 + bne MC_put_x_8_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
958 + ldmfd sp!, {r4-r11,pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
959 +MC_put_x_8_arm_align1: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
960 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
961 +1: ldmia r1, {r4-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
962 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
963 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
964 + ADJ_ALIGN_DW 8, r4, r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
965 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
966 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
967 + stmia r0, {r5-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
968 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
969 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
970 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
971 + ldmfd sp!, {r4-r11,pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
972 +MC_put_x_8_arm_align2: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
973 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
974 +1: ldmia r1, {r4-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
975 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
976 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
977 + ADJ_ALIGN_DW 16, r4, r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
978 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
979 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
980 + stmia r0, {r5-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
981 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
982 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
983 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
984 + ldmfd sp!, {r4-r11,pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
985 +MC_put_x_8_arm_align3: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
986 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
987 +1: ldmia r1, {r4-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
988 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
989 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
990 + ADJ_ALIGN_DW 24, r4, r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
991 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
992 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
993 + stmia r0, {r5-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
994 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
995 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
996 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
997 + ldmfd sp!, {r4-r11,pc} @@ update PC with LR content. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
998 +MC_put_x_8_arm_align_jt: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
999 + .word 0x01010101 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1000 + .word MC_put_x_8_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1001 + .word MC_put_x_8_arm_align1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1002 + .word MC_put_x_8_arm_align2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1003 + .word MC_put_x_8_arm_align3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1004 Index: libmpeg2/motion_comp_iwmmxt.c |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1005 =================================================================== |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1006 --- libmpeg2/motion_comp_iwmmxt.c (revision 0) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1007 +++ libmpeg2/motion_comp_iwmmxt.c (revision 0) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1008 @@ -0,0 +1,61 @@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1009 +/* |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1010 + * motion_comp_iwmmxt.c |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1011 + * Copyright (C) 2004 AGAWA Koji <i (AT) atty (DOT) jp> |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1012 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1013 + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1014 + * See http://libmpeg2.sourceforge.net/ for updates. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1015 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1016 + * mpeg2dec is free software; you can redistribute it and/or modify |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1017 + * it under the terms of the GNU General Public License as published by |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1018 + * the Free Software Foundation; either version 2 of the License, or |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1019 + * (at your option) any later version. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1020 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1021 + * mpeg2dec is distributed in the hope that it will be useful, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1022 + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1023 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1024 + * GNU General Public License for more details. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1025 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1026 + * You should have received a copy of the GNU General Public License |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1027 + * along with this program; if not, write to the Free Software |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1028 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1029 + */ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1030 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1031 +#include "config.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1032 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1033 +#ifdef ARCH_ARM |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1034 +#ifdef HAVE_IWMMXT |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1035 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1036 +#include <inttypes.h> |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1037 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1038 +#include "mpeg2.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1039 +#include "attributes.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1040 +#include "mpeg2_internal.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1041 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1042 +/* defined in libavcodec */ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1043 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1044 +extern void put_pixels16_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1045 +extern void put_pixels16_x2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1046 +extern void put_pixels16_y2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1047 +extern void put_pixels16_xy2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1048 +extern void put_pixels8_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1049 +extern void put_pixels8_x2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1050 +extern void put_pixels8_y2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1051 +extern void put_pixels8_xy2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1052 +extern void avg_pixels16_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1053 +extern void avg_pixels16_x2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1054 +extern void avg_pixels16_y2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1055 +extern void avg_pixels16_xy2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1056 +extern void avg_pixels8_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1057 +extern void avg_pixels8_x2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1058 +extern void avg_pixels8_y2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1059 +extern void avg_pixels8_xy2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1060 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1061 +mpeg2_mc_t mpeg2_mc_iwmmxt = { |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1062 + {put_pixels16_iwmmxt, put_pixels16_x2_iwmmxt, put_pixels16_y2_iwmmxt, put_pixels16_xy2_iwmmxt, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1063 + put_pixels8_iwmmxt, put_pixels8_x2_iwmmxt, put_pixels8_y2_iwmmxt, put_pixels8_xy2_iwmmxt}, \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1064 + {avg_pixels16_iwmmxt, avg_pixels16_x2_iwmmxt, avg_pixels16_y2_iwmmxt, avg_pixels16_xy2_iwmmxt, |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1065 + avg_pixels8_iwmmxt, avg_pixels8_x2_iwmmxt, avg_pixels8_y2_iwmmxt, avg_pixels8_xy2_iwmmxt}, \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1066 +}; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1067 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1068 +#endif |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
1069 +#endif |