Mercurial > mplayer.hg
annotate libmpeg2/libmpeg-0.4.1.diff @ 27540:c1169d855bb7
sync w/r26990 and wording fixes, patch by C¸«±dric Viou
author | gpoirier |
---|---|
date | Wed, 10 Sep 2008 20:05:32 +0000 |
parents | 1462a44ea6b9 |
children |
rev | line source |
---|---|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
1 --- 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
|
2 +++ libmpeg2/cpu_accel.c 2006-06-16 20:12:50.000000000 +0200 |
19026 | 3 @@ -22,6 +26,7 @@ |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
4 */ |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
5 |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
6 #include "config.h" |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
7 +#include "cpudetect.h" |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
8 |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
9 #include <inttypes.h> |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
10 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
11 @@ -30,9 +35,17 @@ |
13864 | 12 #include "mpeg2_internal.h" |
13 | |
14 #ifdef ACCEL_DETECT | |
15 -#ifdef ARCH_X86 | |
16 +#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
|
17 + |
26283
62abac0c8637
cosmetics: Fix some typos and trailing whitespace in local changes.
diego
parents:
26282
diff
changeset
|
18 +/* MPlayer imports libmpeg2 as decoder, which detects MMX / 3DNow! |
62abac0c8637
cosmetics: Fix some typos and trailing whitespace in local changes.
diego
parents:
26282
diff
changeset
|
19 + * instructions via assembly. However, it is regarded as duplicated work |
62abac0c8637
cosmetics: Fix some typos and trailing whitespace in local changes.
diego
parents:
26282
diff
changeset
|
20 + * in MPlayer, so that we enforce using MPlayer's implementation. |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
21 + */ |
27340
33274ce3cce0
Drop USE_ prefix from USE_MPLAYER_CPUDETECT #define.
diego
parents:
26896
diff
changeset
|
22 +#define MPLAYER_CPUDETECT |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
23 + |
13864 | 24 static inline uint32_t arch_accel (void) |
25 { | |
27340
33274ce3cce0
Drop USE_ prefix from USE_MPLAYER_CPUDETECT #define.
diego
parents:
26896
diff
changeset
|
26 +#if !defined(MPLAYER_CPUDETECT) |
13864 | 27 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
|
28 int AMD; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
29 uint32_t caps; |
27521 | 30 @@ -107,8 +120,22 @@ |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
31 caps |= MPEG2_ACCEL_X86_MMXEXT; |
13864 | 32 |
33 return caps; | |
27340
33274ce3cce0
Drop USE_ prefix from USE_MPLAYER_CPUDETECT #define.
diego
parents:
26896
diff
changeset
|
34 +#else /* MPLAYER_CPUDETECT: Use MPlayer's CPU capability property. */ |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
35 + caps = 0; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
36 + if (gCpuCaps.hasMMX) |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
37 + caps |= MPEG2_ACCEL_X86_MMX; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
38 + if (gCpuCaps.hasSSE2) |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
39 + caps |= MPEG2_ACCEL_X86_SSE2; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
40 + if (gCpuCaps.hasMMX2) |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
41 + caps |= MPEG2_ACCEL_X86_MMXEXT; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
42 + if (gCpuCaps.has3DNow) |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
43 + caps |= MPEG2_ACCEL_X86_3DNOW; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
44 + |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
45 + return caps; |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
46 + |
27340
33274ce3cce0
Drop USE_ prefix from USE_MPLAYER_CPUDETECT #define.
diego
parents:
26896
diff
changeset
|
47 +#endif /* MPLAYER_CPUDETECT */ |
13020 | 48 } |
13864 | 49 -#endif /* ARCH_X86 */ |
50 +#endif /* ARCH_X86 || ARCH_X86_64 */ | |
13020 | 51 |
26282
79ab4ecba54a
Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents:
26047
diff
changeset
|
52 #if defined(ARCH_PPC) || defined(ARCH_SPARC) |
27521 | 53 #include <signal.h> |
54 @@ -214,7 +241,7 @@ | |
13864 | 55 |
56 accel = 0; | |
57 #ifdef ACCEL_DETECT | |
58 -#if defined (ARCH_X86) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC) | |
59 +#if defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC) | |
60 accel = arch_accel (); | |
61 #endif | |
62 #endif | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
63 --- 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
|
64 +++ 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
|
65 @@ -29,14 +33,14 @@ |
13864 | 66 #include "mpeg2.h" |
67 #include "attributes.h" | |
68 #include "mpeg2_internal.h" | |
69 -#ifdef ARCH_X86 | |
70 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
71 #include "mmx.h" | |
72 #endif | |
73 | |
74 void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL; | |
75 void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL; | |
76 | |
77 -#ifdef ARCH_X86 | |
78 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
79 static void state_restore_mmx (cpu_state_t * state) | |
80 { | |
81 emms (); | |
27521 | 82 @@ -44,18 +48,18 @@ |
21571 | 83 #endif |
84 | |
26595 | 85 #ifdef ARCH_PPC |
21571 | 86 -#ifdef HAVE_ALTIVEC_H /* gnu */ |
87 -#define LI(a,b) "li " #a "," #b "\n\t" | |
88 -#define STVX0(a,b,c) "stvx " #a ",0," #c "\n\t" | |
89 -#define STVX(a,b,c) "stvx " #a "," #b "," #c "\n\t" | |
90 -#define LVX0(a,b,c) "lvx " #a ",0," #c "\n\t" | |
91 -#define LVX(a,b,c) "lvx " #a "," #b "," #c "\n\t" | |
92 -#else /* apple */ | |
25980
11181df06389
Do not check for __APPLE_ALTIVEC__, just check for __APPLE_CC__.
diego
parents:
24720
diff
changeset
|
93 +#if defined(__APPLE_CC__) /* apple */ |
21571 | 94 #define LI(a,b) "li r" #a "," #b "\n\t" |
95 #define STVX0(a,b,c) "stvx v" #a ",0,r" #c "\n\t" | |
96 #define STVX(a,b,c) "stvx v" #a ",r" #b ",r" #c "\n\t" | |
97 #define LVX0(a,b,c) "lvx v" #a ",0,r" #c "\n\t" | |
98 #define LVX(a,b,c) "lvx v" #a ",r" #b ",r" #c "\n\t" | |
99 +#else /* gnu */ | |
100 +#define LI(a,b) "li " #a "," #b "\n\t" | |
101 +#define STVX0(a,b,c) "stvx " #a ",0," #c "\n\t" | |
102 +#define STVX(a,b,c) "stvx " #a "," #b "," #c "\n\t" | |
103 +#define LVX0(a,b,c) "lvx " #a ",0," #c "\n\t" | |
104 +#define LVX(a,b,c) "lvx " #a "," #b "," #c "\n\t" | |
105 #endif | |
106 | |
107 static void state_save_altivec (cpu_state_t * state) | |
27521 | 108 @@ -115,7 +119,7 @@ |
13864 | 109 |
110 void mpeg2_cpu_state_init (uint32_t accel) | |
111 { | |
112 -#ifdef ARCH_X86 | |
113 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
114 if (accel & MPEG2_ACCEL_X86_MMX) { | |
12937 | 115 mpeg2_cpu_state_restore = state_restore_mmx; |
116 } | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
117 --- 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
|
118 +++ 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
|
119 @@ -351,6 +355,15 @@ |
12937 | 120 fbuf->buf[1] = buf[1]; |
121 fbuf->buf[2] = buf[2]; | |
122 fbuf->id = id; | |
123 + // HACK! FIXME! At first I frame, copy pointers to prediction frame too! | |
124 + if (mpeg2dec->custom_fbuf && !mpeg2dec->fbuf[1]->buf[0]){ | |
125 + mpeg2dec->fbuf[1]->buf[0]=buf[0]; | |
126 + mpeg2dec->fbuf[1]->buf[1]=buf[1]; | |
127 + mpeg2dec->fbuf[1]->buf[2]=buf[2]; | |
128 + mpeg2dec->fbuf[1]->id=NULL; | |
129 + } | |
130 +// printf("libmpeg2: FBUF 0:%p 1:%p 2:%p\n", | |
131 +// mpeg2dec->fbuf[0]->buf[0],mpeg2dec->fbuf[1]->buf[0],mpeg2dec->fbuf[2]->buf[0]); | |
132 } | |
133 | |
134 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
|
135 --- 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
|
136 +++ 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
|
137 @@ -100,6 +104,9 @@ |
12937 | 138 mpeg2dec->decoder.convert = NULL; |
139 mpeg2dec->decoder.convert_id = NULL; | |
140 mpeg2dec->picture = mpeg2dec->pictures; | |
141 + memset(&mpeg2dec->fbuf_alloc[0].fbuf, 0, sizeof(mpeg2_fbuf_t)); | |
142 + memset(&mpeg2dec->fbuf_alloc[1].fbuf, 0, sizeof(mpeg2_fbuf_t)); | |
143 + memset(&mpeg2dec->fbuf_alloc[2].fbuf, 0, sizeof(mpeg2_fbuf_t)); | |
144 mpeg2dec->fbuf[0] = &mpeg2dec->fbuf_alloc[0].fbuf; | |
145 mpeg2dec->fbuf[1] = &mpeg2dec->fbuf_alloc[1].fbuf; | |
146 mpeg2dec->fbuf[2] = &mpeg2dec->fbuf_alloc[2].fbuf; | |
27521 | 147 @@ -553,6 +560,7 @@ |
12937 | 148 if (!(mpeg2dec->sequence.flags & SEQ_FLAG_PROGRESSIVE_SEQUENCE)) { |
149 picture->nb_fields = (buffer[3] & 2) ? 3 : 2; | |
150 flags |= (buffer[3] & 128) ? PIC_FLAG_TOP_FIELD_FIRST : 0; | |
151 + flags |= (buffer[3] & 2) ? PIC_FLAG_REPEAT_FIRST_FIELD : 0; | |
152 } else | |
153 picture->nb_fields = (buffer[3]&2) ? ((buffer[3]&128) ? 6 : 4) : 2; | |
154 break; | |
27521 | 155 @@ -801,6 +809,7 @@ |
12937 | 156 mpeg2dec->scaled[index] = mpeg2dec->q_scale_type; |
157 for (i = 0; i < 32; i++) { | |
158 k = mpeg2dec->q_scale_type ? non_linear_scale[i] : (i << 1); | |
13147 | 159 + decoder->quantizer_scales[i] = k; |
12937 | 160 for (j = 0; j < 64; j++) |
161 decoder->quantizer_prescale[index][i][j] = | |
162 k * mpeg2dec->quantizer_matrix[index][j]; | |
26625
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
163 --- libmpeg2/idct.c (revision 26652) |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
164 +++ libmpeg2/idct.c (working copy) |
27522
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
165 @@ -235,30 +239,40 @@ |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
166 |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
167 void mpeg2_idct_init (uint32_t accel) |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
168 { |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
169 -#ifdef ARCH_X86 |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
170 +#ifdef HAVE_SSE2 |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
171 + if (accel & MPEG2_ACCEL_X86_SSE2) { |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
172 + mpeg2_idct_copy = mpeg2_idct_copy_sse2; |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
173 + mpeg2_idct_add = mpeg2_idct_add_sse2; |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
174 + mpeg2_idct_mmx_init (); |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
175 + } else |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
176 +#elif HAVE_MMX2 |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
177 if (accel & MPEG2_ACCEL_X86_MMXEXT) { |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
178 mpeg2_idct_copy = mpeg2_idct_copy_mmxext; |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
179 mpeg2_idct_add = mpeg2_idct_add_mmxext; |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
180 mpeg2_idct_mmx_init (); |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
181 - } else if (accel & MPEG2_ACCEL_X86_MMX) { |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
182 + } else |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
183 +#elif HAVE_MMX |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
184 + if (accel & MPEG2_ACCEL_X86_MMX) { |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
185 mpeg2_idct_copy = mpeg2_idct_copy_mmx; |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
186 mpeg2_idct_add = mpeg2_idct_add_mmx; |
26625
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
187 mpeg2_idct_mmx_init (); |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
188 } else |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
189 #endif |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
190 -#ifdef ARCH_PPC |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
191 +#ifdef HAVE_ALTIVEC |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
192 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) { |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
193 mpeg2_idct_copy = mpeg2_idct_copy_altivec; |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
194 mpeg2_idct_add = mpeg2_idct_add_altivec; |
27522
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
195 mpeg2_idct_altivec_init (); |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
196 } else |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
197 #endif |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
198 -#ifdef ARCH_ALPHA |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
199 +#ifdef HAVE_VIS |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
200 if (accel & MPEG2_ACCEL_ALPHA_MVI) { |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
201 mpeg2_idct_copy = mpeg2_idct_copy_mvi; |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
202 mpeg2_idct_add = mpeg2_idct_add_mvi; |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
203 mpeg2_idct_alpha_init (); |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
204 - } else if (accel & MPEG2_ACCEL_ALPHA) { |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
205 + } else |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
206 +#elif ARCH_ALPHA |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
207 + if (accel & MPEG2_ACCEL_ALPHA) { |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
208 int i; |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
209 |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
210 mpeg2_idct_copy = mpeg2_idct_copy_alpha; |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
211 --- 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
|
212 +++ 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
|
213 @@ -23,7 +27,7 @@ |
13864 | 214 |
215 #include "config.h" | |
12937 | 216 |
13864 | 217 -#ifdef ARCH_X86 |
218 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
219 | |
220 #include <inttypes.h> | |
12937 | 221 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
222 --- 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
|
223 +++ libmpeg2/motion_comp.c 2006-06-16 20:12:50.000000000 +0200 |
27522
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
224 @@ -33,16 +37,22 @@ |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
225 |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
226 void mpeg2_mc_init (uint32_t accel) |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
227 { |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
228 -#ifdef ARCH_X86 |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
229 +#ifdef HAVE_MMX2 |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
230 if (accel & MPEG2_ACCEL_X86_MMXEXT) |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
231 mpeg2_mc = mpeg2_mc_mmxext; |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
232 - else if (accel & MPEG2_ACCEL_X86_3DNOW) |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
233 + else |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
234 +#endif |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
235 +#ifdef HAVE_3DNOW |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
236 + if (accel & MPEG2_ACCEL_X86_3DNOW) |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
237 mpeg2_mc = mpeg2_mc_3dnow; |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
238 - else if (accel & MPEG2_ACCEL_X86_MMX) |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
239 + else |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
240 +#endif |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
241 +#ifdef HAVE_MMX |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
242 + if (accel & MPEG2_ACCEL_X86_MMX) |
26625
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
243 mpeg2_mc = mpeg2_mc_mmx; |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
244 else |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
245 #endif |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
246 -#ifdef ARCH_PPC |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
247 +#ifdef HAVE_ALTIVEC |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
248 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
249 mpeg2_mc = mpeg2_mc_altivec; |
5b89b42f6d50
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
diego
parents:
26595
diff
changeset
|
250 else |
27522
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
251 @@ -52,11 +62,21 @@ |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
252 mpeg2_mc = mpeg2_mc_alpha; |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
253 else |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
254 #endif |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
255 -#ifdef ARCH_SPARC |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
256 +#ifdef HAVE_VIS |
1462a44ea6b9
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
diego
parents:
27521
diff
changeset
|
257 if (accel & MPEG2_ACCEL_SPARC_VIS) |
23236
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
258 mpeg2_mc = mpeg2_mc_vis; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
259 else |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
260 #endif |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
261 +#ifdef ARCH_ARM |
27361
7cf315c4707f
Fix ARM linking failure when IWMMXT support is disabled.
diego
parents:
27360
diff
changeset
|
262 +#ifdef HAVE_IWMMXT |
26282
79ab4ecba54a
Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents:
26047
diff
changeset
|
263 + if (accel & MPEG2_ACCEL_ARM_IWMMXT) |
79ab4ecba54a
Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents:
26047
diff
changeset
|
264 + mpeg2_mc = mpeg2_mc_iwmmxt; |
27361
7cf315c4707f
Fix ARM linking failure when IWMMXT support is disabled.
diego
parents:
27360
diff
changeset
|
265 + else |
7cf315c4707f
Fix ARM linking failure when IWMMXT support is disabled.
diego
parents:
27360
diff
changeset
|
266 +#endif |
7cf315c4707f
Fix ARM linking failure when IWMMXT support is disabled.
diego
parents:
27360
diff
changeset
|
267 + if (accel & MPEG2_ACCEL_ARM) |
26282
79ab4ecba54a
Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents:
26047
diff
changeset
|
268 + mpeg2_mc = mpeg2_mc_arm; |
79ab4ecba54a
Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents:
26047
diff
changeset
|
269 + else |
23236
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
270 +#endif |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
271 mpeg2_mc = mpeg2_mc_c; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
272 } |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
273 |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
274 --- 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
|
275 +++ 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
|
276 @@ -23,7 +27,7 @@ |
13864 | 277 |
278 #include "config.h" | |
279 | |
280 -#ifdef ARCH_X86 | |
281 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
282 | |
283 #include <inttypes.h> | |
284 | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
285 --- 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
|
286 +++ 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
|
287 @@ -82,6 +86,7 @@ |
13147 | 288 #define PIC_FLAG_COMPOSITE_DISPLAY 32 |
289 #define PIC_FLAG_SKIP 64 | |
290 #define PIC_FLAG_TAGS 128 | |
291 +#define PIC_FLAG_REPEAT_FIRST_FIELD 256 | |
292 #define PIC_MASK_COMPOSITE_DISPLAY 0xfffff000 | |
293 | |
294 typedef struct mpeg2_picture_s { | |
27521 | 295 @@ -154,11 +159,14 @@ |
296 #define MPEG2_ACCEL_X86_MMX 1 | |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
297 #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
|
298 #define MPEG2_ACCEL_X86_MMXEXT 4 |
26047 | 299 +#define MPEG2_ACCEL_X86_SSE2 8 |
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
300 #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
|
301 #define MPEG2_ACCEL_ALPHA 1 |
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
302 #define MPEG2_ACCEL_ALPHA_MVI 2 |
26046 | 303 #define MPEG2_ACCEL_SPARC_VIS 1 |
304 #define MPEG2_ACCEL_SPARC_VIS2 2 | |
305 +#define MPEG2_ACCEL_ARM 1 | |
306 +#define MPEG2_ACCEL_ARM_IWMMXT 2 | |
307 #define MPEG2_ACCEL_DETECT 0x80000000 | |
308 | |
309 uint32_t mpeg2_accel (uint32_t accel); | |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
310 --- 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
|
311 +++ libmpeg2/mpeg2_internal.h 2006-06-16 20:12:50.000000000 +0200 |
26284 | 312 @@ -144,6 +148,11 @@ |
12937 | 313 int second_field; |
314 | |
315 int mpeg1; | |
316 + | |
13147 | 317 + int quantizer_scales[32]; |
12937 | 318 + int quantizer_scale; |
319 + char* quant_store; | |
320 + int quant_stride; | |
321 }; | |
322 | |
323 typedef struct { | |
27521 | 324 @@ -214,6 +223,9 @@ |
13147 | 325 int8_t q_scale_type, scaled[4]; |
326 uint8_t quantizer_matrix[4][64]; | |
327 uint8_t new_quantizer_matrix[4][64]; | |
328 + | |
329 + unsigned char *pending_buffer; | |
330 + int pending_length; | |
331 }; | |
332 | |
333 typedef struct { | |
27521 | 334 @@ -298,3 +313,5 @@ |
23236
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
335 extern mpeg2_mc_t mpeg2_mc_altivec; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
336 extern mpeg2_mc_t mpeg2_mc_alpha; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
337 extern mpeg2_mc_t mpeg2_mc_vis; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
338 +extern mpeg2_mc_t mpeg2_mc_arm; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
339 +extern mpeg2_mc_t mpeg2_mc_iwmmxt; |
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
340 --- 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
|
341 +++ 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
|
342 @@ -142,6 +146,7 @@ |
13147 | 343 |
344 quantizer_scale_code = UBITS (bit_buf, 5); | |
345 DUMPBITS (bit_buf, bits, 5); | |
346 + decoder->quantizer_scale = decoder->quantizer_scales[quantizer_scale_code]; | |
347 | |
348 decoder->quantizer_matrix[0] = | |
349 decoder->quantizer_prescale[0][quantizer_scale_code]; | |
27521 | 350 @@ -1564,6 +1569,18 @@ |
12937 | 351 |
352 #define NEXT_MACROBLOCK \ | |
353 do { \ | |
20640 | 354 + if(decoder->quant_store) { \ |
355 + if (decoder->picture_structure == TOP_FIELD) \ | |
356 + decoder->quant_store[2*decoder->quant_stride*(decoder->v_offset>>4) \ | |
357 + +(decoder->offset>>4)] = decoder->quantizer_scale; \ | |
358 + else if (decoder->picture_structure == BOTTOM_FIELD) \ | |
359 + decoder->quant_store[2*decoder->quant_stride*(decoder->v_offset>>4) \ | |
360 + + decoder->quant_stride \ | |
361 + +(decoder->offset>>4)] = decoder->quantizer_scale; \ | |
362 + else \ | |
12937 | 363 + decoder->quant_store[decoder->quant_stride*(decoder->v_offset>>4) \ |
364 + +(decoder->offset>>4)] = decoder->quantizer_scale; \ | |
20640 | 365 + } \ |
12937 | 366 decoder->offset += 16; \ |
367 if (decoder->offset == decoder->width) { \ | |
368 do { /* just so we can use the break statement */ \ | |
27521 | 369 @@ -1587,6 +1604,12 @@ |
21923
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
370 } \ |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
371 } while (0) |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
372 |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
373 +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
|
374 + motion_t * const motion, |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
375 + mpeg2_mc_fct * const * const table) |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
376 +{ |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
377 +} |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
378 + |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
379 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
|
380 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
|
381 { |
27521 | 382 @@ -1644,7 +1667,9 @@ |
21923
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
383 |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
384 if (decoder->mpeg1) { |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
385 decoder->motion_parser[0] = motion_zero_420; |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
386 + decoder->motion_parser[MC_FIELD] = motion_dummy; |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
387 decoder->motion_parser[MC_FRAME] = motion_mp1; |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
388 + decoder->motion_parser[MC_DMV] = motion_dummy; |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
389 decoder->motion_parser[4] = motion_reuse_420; |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
390 } else if (decoder->picture_structure == FRAME_PICTURE) { |
1658f7d97b27
fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents:
21571
diff
changeset
|
391 if (decoder->chroma_format == 0) { |
21571 | 392 --- libmpeg2/idct_altivec.c 2004/08/02 11:26:43 12933 |
393 +++ libmpeg2/idct_altivec.c 2005/05/15 20:11:34 15484 | |
394 @@ -41,7 +41,7 @@ | |
395 typedef vector signed int vector_s32_t; | |
396 typedef vector unsigned int vector_u32_t; | |
397 | |
398 -#if defined(HAVE_ALTIVEC_H) && (__GNUC__ * 100 + __GNUC_MINOR__ < 303) | |
25980
11181df06389
Do not check for __APPLE_ALTIVEC__, just check for __APPLE_CC__.
diego
parents:
24720
diff
changeset
|
399 +#if defined(HAVE_ALTIVEC_H) && !defined(__APPLE_CC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 303) |
21571 | 400 /* work around gcc <3.3 vec_mergel bug */ |
401 static inline vector_s16_t my_vec_mergel (vector_s16_t const A, | |
402 vector_s16_t const B) | |
23236
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
403 Index: libmpeg2/motion_comp_arm.c |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
404 =================================================================== |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
405 --- libmpeg2/motion_comp_arm.c (revision 0) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
406 +++ libmpeg2/motion_comp_arm.c (revision 0) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
407 @@ -0,0 +1,187 @@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
408 +/* |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
409 + * motion_comp_arm.c |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
410 + * 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
|
411 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
412 + * 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
|
413 + * See http://libmpeg2.sourceforge.net/ for updates. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
414 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
415 + * 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
|
416 + * 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
|
417 + * 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
|
418 + * (at your option) any later version. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
419 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
420 + * 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
|
421 + * 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
|
422 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
423 + * GNU General Public License for more details. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
424 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
425 + * 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
|
426 + * 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
|
427 + * 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
|
428 + */ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
429 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
430 +#include "config.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
431 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
432 +#ifdef ARCH_ARM |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
433 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
434 +#include <inttypes.h> |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
435 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
436 +#include "mpeg2.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
437 +#include "attributes.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
438 +#include "mpeg2_internal.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
439 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
440 +#define avg2(a,b) ((a+b+1)>>1) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
441 +#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
|
442 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
443 +#define predict_o(i) (ref[i]) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
444 +#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
|
445 +#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
|
446 +#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
|
447 + (ref+stride)[i], (ref+stride)[i+1])) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
448 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
449 +#define put(predictor,i) dest[i] = predictor (i) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
450 +#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
|
451 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
452 +/* mc function template */ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
453 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
454 +#define MC_FUNC(op,xy) \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
455 +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
|
456 + const int stride, int height) \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
457 +{ \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
458 + do { \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
459 + op (predict_##xy, 0); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
460 + op (predict_##xy, 1); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
461 + op (predict_##xy, 2); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
462 + op (predict_##xy, 3); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
463 + op (predict_##xy, 4); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
464 + op (predict_##xy, 5); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
465 + op (predict_##xy, 6); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
466 + op (predict_##xy, 7); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
467 + op (predict_##xy, 8); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
468 + op (predict_##xy, 9); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
469 + op (predict_##xy, 10); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
470 + op (predict_##xy, 11); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
471 + op (predict_##xy, 12); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
472 + op (predict_##xy, 13); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
473 + op (predict_##xy, 14); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
474 + op (predict_##xy, 15); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
475 + ref += stride; \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
476 + dest += stride; \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
477 + } while (--height); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
478 +} \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
479 +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
|
480 + const int stride, int height) \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
481 +{ \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
482 + do { \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
483 + op (predict_##xy, 0); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
484 + op (predict_##xy, 1); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
485 + op (predict_##xy, 2); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
486 + op (predict_##xy, 3); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
487 + op (predict_##xy, 4); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
488 + op (predict_##xy, 5); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
489 + op (predict_##xy, 6); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
490 + op (predict_##xy, 7); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
491 + ref += stride; \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
492 + dest += stride; \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
493 + } while (--height); \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
494 +} \ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
495 +/* definitions of the actual mc functions */ |
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 +MC_FUNC (put,o) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
498 +MC_FUNC (avg,o) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
499 +MC_FUNC (put,x) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
500 +MC_FUNC (avg,x) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
501 +MC_FUNC (put,y) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
502 +MC_FUNC (avg,y) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
503 +MC_FUNC (put,xy) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
504 +MC_FUNC (avg,xy) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
505 + |
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 +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
|
508 + int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
509 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
510 +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
|
511 + int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
512 + |
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 +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
|
515 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
516 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
517 + MC_put_y_16_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
518 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
519 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
520 +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
|
521 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
522 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
523 + MC_put_xy_16_c(dest, ref, stride, height); |
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 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
526 +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
|
527 + int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
528 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
529 +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
|
530 + int stride, int height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
531 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
532 +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
|
533 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
534 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
535 + MC_put_y_8_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
536 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
537 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
538 +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
|
539 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
540 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
541 + MC_put_xy_8_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
542 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
543 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
544 +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
|
545 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
546 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
547 + MC_avg_o_16_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
548 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
549 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
550 +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
|
551 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
552 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
553 + MC_avg_x_16_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
554 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
555 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
556 +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
|
557 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
558 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
559 + MC_avg_y_16_c(dest, ref, stride, 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 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
562 +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
|
563 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
564 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
565 + MC_avg_xy_16_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
566 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
567 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
568 +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
|
569 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
570 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
571 + MC_avg_o_8_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
572 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
573 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
574 +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
|
575 + int stride, int 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 + MC_avg_x_8_c(dest, ref, stride, height); |
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 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
580 +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
|
581 + int stride, int height) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
582 +{ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
583 + MC_avg_y_8_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
584 +} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
585 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
586 +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
|
587 + int stride, int height) |
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 + MC_avg_xy_8_c(dest, ref, stride, height); |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
590 +} |
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 +MPEG2_MC_EXTERN (arm) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
593 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
594 +#endif |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
595 Index: libmpeg2/motion_comp_arm_s.S |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
596 =================================================================== |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
597 --- libmpeg2/motion_comp_arm_s.S (revision 0) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
598 +++ libmpeg2/motion_comp_arm_s.S (revision 0) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
599 @@ -0,0 +1,322 @@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
600 +@ motion_comp_arm_s.S |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
601 +@ 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
|
602 +@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
603 +@ 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
|
604 +@ See http://libmpeg2.sourceforge.net/ for updates. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
605 +@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
606 +@ 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
|
607 +@ 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
|
608 +@ 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
|
609 +@ (at your option) any later version. |
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 +@ 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
|
612 +@ 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
|
613 +@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
614 +@ GNU General Public License for more details. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
615 +@ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
616 +@ 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
|
617 +@ 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
|
618 +@ 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
|
619 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
620 + .text |
26283
62abac0c8637
cosmetics: Fix some typos and trailing whitespace in local changes.
diego
parents:
26282
diff
changeset
|
621 + |
23236
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 + .align |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
624 + .global MC_put_o_16_arm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
625 +MC_put_o_16_arm: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
626 + @@ 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
|
627 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
628 + 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
|
629 + and r4, r1, #3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
630 + adr r5, MC_put_o_16_arm_align_jt |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
631 + add r5, r5, r4, lsl #2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
632 + ldr pc, [r5] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
633 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
634 +MC_put_o_16_arm_align0: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
635 + ldmia r1, {r4-r7} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
636 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
637 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
638 + stmia r0, {r4-r7} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
639 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
640 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
641 + bne MC_put_o_16_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
642 + 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
|
643 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
644 +.macro PROC shift |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
645 + ldmia r1, {r4-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
646 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
647 + mov r9, r4, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
648 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
649 + mov r10, r5, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
650 + orr r9, r9, r5, lsl #(32-\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
651 + mov r11, r6, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
652 + orr r10, r10, r6, lsl #(32-\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
653 + mov r12, r7, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
654 + orr r11, r11, r7, lsl #(32-\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
655 + orr r12, r12, r8, lsl #(32-\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
656 + stmia r0, {r9-r12} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
657 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
658 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
659 +.endm |
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 +MC_put_o_16_arm_align1: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
662 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
663 +1: PROC(8) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
664 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
665 + 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
|
666 +MC_put_o_16_arm_align2: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
667 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
668 +1: PROC(16) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
669 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
670 + 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
|
671 +MC_put_o_16_arm_align3: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
672 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
673 +1: PROC(24) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
674 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
675 + 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
|
676 +MC_put_o_16_arm_align_jt: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
677 + .word MC_put_o_16_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
678 + .word MC_put_o_16_arm_align1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
679 + .word MC_put_o_16_arm_align2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
680 + .word MC_put_o_16_arm_align3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
681 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
682 +@ ---------------------------------------------------------------- |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
683 + .align |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
684 + .global MC_put_o_8_arm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
685 +MC_put_o_8_arm: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
686 + @@ 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
|
687 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
688 + 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
|
689 + and r4, r1, #3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
690 + adr r5, MC_put_o_8_arm_align_jt |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
691 + add r5, r5, r4, lsl #2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
692 + ldr pc, [r5] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
693 +MC_put_o_8_arm_align0: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
694 + ldmia r1, {r4-r5} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
695 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
696 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
697 + stmia r0, {r4-r5} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
698 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
699 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
700 + bne MC_put_o_8_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
701 + 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
|
702 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
703 +.macro PROC8 shift |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
704 + ldmia r1, {r4-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
705 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
706 + mov r9, r4, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
707 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
708 + mov r10, r5, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
709 + orr r9, r9, r5, lsl #(32-\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
710 + orr r10, r10, r6, lsl #(32-\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
711 + stmia r0, {r9-r10} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
712 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
713 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
714 +.endm |
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_8_arm_align1: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
717 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
718 +1: PROC8(8) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
719 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
720 + 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
|
721 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
722 +MC_put_o_8_arm_align2: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
723 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
724 +1: PROC8(16) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
725 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
726 + 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
|
727 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
728 +MC_put_o_8_arm_align3: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
729 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
730 +1: PROC8(24) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
731 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
732 + 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
|
733 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
734 +MC_put_o_8_arm_align_jt: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
735 + .word MC_put_o_8_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
736 + .word MC_put_o_8_arm_align1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
737 + .word MC_put_o_8_arm_align2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
738 + .word MC_put_o_8_arm_align3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
739 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
740 +@ ---------------------------------------------------------------- |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
741 +.macro AVG_PW rW1, rW2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
742 + mov \rW2, \rW2, lsl #24 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
743 + orr \rW2, \rW2, \rW1, lsr #8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
744 + eor r9, \rW1, \rW2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
745 + and \rW2, \rW1, \rW2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
746 + and r10, r9, r12 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
747 + add \rW2, \rW2, r10, lsr #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
748 + and r10, r9, r11 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
749 + add \rW2, \rW2, r10 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
750 +.endm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
751 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
752 + .align |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
753 + .global MC_put_x_16_arm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
754 +MC_put_x_16_arm: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
755 + @@ 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
|
756 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
757 + 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
|
758 + and r4, r1, #3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
759 + adr r5, MC_put_x_16_arm_align_jt |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
760 + ldr r11, [r5] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
761 + mvn r12, r11 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
762 + add r5, r5, r4, lsl #2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
763 + ldr pc, [r5, #4] |
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 +.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
|
766 + mov \R0, \R0, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
767 + orr \R0, \R0, \R1, lsl #(32 - \shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
768 + mov \R1, \R1, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
769 + orr \R1, \R1, \R2, lsl #(32 - \shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
770 + mov \R2, \R2, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
771 + orr \R2, \R2, \R3, lsl #(32 - \shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
772 + mov \R3, \R3, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
773 + orr \R3, \R3, \R4, lsl #(32 - \shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
774 + mov \R4, \R4, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
775 +@ and \R4, \R4, #0xFF |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
776 +.endm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
777 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
778 +MC_put_x_16_arm_align0: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
779 + ldmia r1, {r4-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
780 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
781 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
782 + AVG_PW r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
783 + AVG_PW r6, r7 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
784 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
785 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
786 + stmia r0, {r5-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
787 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
788 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
789 + bne MC_put_x_16_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
790 + 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
|
791 +MC_put_x_16_arm_align1: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
792 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
793 +1: ldmia r1, {r4-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
794 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
795 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
796 + ADJ_ALIGN_QW 8, r4, r5, r6, r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
797 + AVG_PW r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
798 + AVG_PW r6, r7 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
799 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
800 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
801 + stmia r0, {r5-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
802 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
803 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
804 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
805 + 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
|
806 +MC_put_x_16_arm_align2: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
807 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
808 +1: ldmia r1, {r4-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
809 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
810 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
811 + ADJ_ALIGN_QW 16, r4, r5, r6, r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
812 + AVG_PW r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
813 + AVG_PW r6, r7 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
814 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
815 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
816 + stmia r0, {r5-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
817 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
818 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
819 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
820 + 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
|
821 +MC_put_x_16_arm_align3: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
822 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
823 +1: ldmia r1, {r4-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
824 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
825 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
826 + ADJ_ALIGN_QW 24, r4, r5, r6, r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
827 + AVG_PW r7, r8 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
828 + AVG_PW r6, r7 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
829 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
830 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
831 + stmia r0, {r5-r8} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
832 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
833 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
834 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
835 + 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
|
836 +MC_put_x_16_arm_align_jt: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
837 + .word 0x01010101 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
838 + .word MC_put_x_16_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
839 + .word MC_put_x_16_arm_align1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
840 + .word MC_put_x_16_arm_align2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
841 + .word MC_put_x_16_arm_align3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
842 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
843 +@ ---------------------------------------------------------------- |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
844 + .align |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
845 + .global MC_put_x_8_arm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
846 +MC_put_x_8_arm: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
847 + @@ 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
|
848 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
849 + 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
|
850 + and r4, r1, #3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
851 + adr r5, MC_put_x_8_arm_align_jt |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
852 + ldr r11, [r5] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
853 + mvn r12, r11 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
854 + add r5, r5, r4, lsl #2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
855 + ldr pc, [r5, #4] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
856 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
857 +.macro ADJ_ALIGN_DW shift, R0, R1, R2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
858 + mov \R0, \R0, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
859 + orr \R0, \R0, \R1, lsl #(32 - \shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
860 + mov \R1, \R1, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
861 + orr \R1, \R1, \R2, lsl #(32 - \shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
862 + mov \R2, \R2, lsr #(\shift) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
863 +@ and \R4, \R4, #0xFF |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
864 +.endm |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
865 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
866 +MC_put_x_8_arm_align0: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
867 + ldmia r1, {r4-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
868 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
869 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
870 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
871 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
872 + stmia r0, {r5-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
873 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
874 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
875 + bne MC_put_x_8_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
876 + 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
|
877 +MC_put_x_8_arm_align1: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
878 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
879 +1: ldmia r1, {r4-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
880 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
881 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
882 + ADJ_ALIGN_DW 8, r4, r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
883 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
884 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
885 + stmia r0, {r5-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
886 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
887 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
888 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
889 + 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
|
890 +MC_put_x_8_arm_align2: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
891 + and r1, r1, #0xFFFFFFFC |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
892 +1: ldmia r1, {r4-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
893 + add r1, r1, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
894 + pld [r1] |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
895 + ADJ_ALIGN_DW 16, r4, r5, r6 |
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-r6} |
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_8_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-r6} |
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_DW 24, r4, r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
909 + AVG_PW r5, r6 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
910 + AVG_PW r4, r5 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
911 + stmia r0, {r5-r6} |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
912 + subs r3, r3, #1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
913 + add r0, r0, r2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
914 + bne 1b |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
915 + 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
|
916 +MC_put_x_8_arm_align_jt: |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
917 + .word 0x01010101 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
918 + .word MC_put_x_8_arm_align0 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
919 + .word MC_put_x_8_arm_align1 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
920 + .word MC_put_x_8_arm_align2 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
921 + .word MC_put_x_8_arm_align3 |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
922 Index: libmpeg2/motion_comp_iwmmxt.c |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
923 =================================================================== |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
924 --- libmpeg2/motion_comp_iwmmxt.c (revision 0) |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
925 +++ libmpeg2/motion_comp_iwmmxt.c (revision 0) |
26044 | 926 @@ -0,0 +1,59 @@ |
23236
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
927 +/* |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
928 + * motion_comp_iwmmxt.c |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
929 + * 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
|
930 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
931 + * 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
|
932 + * See http://libmpeg2.sourceforge.net/ for updates. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
933 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
934 + * 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
|
935 + * 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
|
936 + * 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
|
937 + * (at your option) any later version. |
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 + * 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
|
940 + * 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
|
941 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
942 + * GNU General Public License for more details. |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
943 + * |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
944 + * 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
|
945 + * 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
|
946 + * 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
|
947 + */ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
948 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
949 +#include "config.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
950 + |
26044 | 951 +#if defined(ARCH_ARM) && defined(HAVE_IWMMXT) |
23236
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
952 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
953 +#include <inttypes.h> |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
954 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
955 +#include "mpeg2.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
956 +#include "attributes.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
957 +#include "mpeg2_internal.h" |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
958 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
959 +/* defined in libavcodec */ |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
960 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
961 +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
|
962 +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
|
963 +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
|
964 +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
|
965 +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
|
966 +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
|
967 +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
|
968 +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
|
969 +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
|
970 +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
|
971 +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
|
972 +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
|
973 +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
|
974 +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
|
975 +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
|
976 +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
|
977 + |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
978 +mpeg2_mc_t mpeg2_mc_iwmmxt = { |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
979 + {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
|
980 + 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
|
981 + {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
|
982 + 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
|
983 +}; |
f0ddd02aec27
iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents:
21923
diff
changeset
|
984 + |
26044 | 985 +#endif /* defined(ARCH_ARM) && defined(HAVE_IWMMXT) */ |