annotate libmpeg2/libmpeg-0.4.1.diff @ 26327:fa91545f01bb

Split the aac header parsing out of aac demuxer to allow using libmpmux without libmpdemux.
author albeu
date Wed, 09 Apr 2008 00:43:19 +0000
parents c5cd2eedc579
children 4bc81fcf14bb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
de3edca9a962 Remove copyright notice changes from local diff.
diego
parents: 19024
diff changeset
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
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
12 #include "mpeg2_internal.h"
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
13
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
14 #ifdef ACCEL_DETECT
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
15 -#ifdef ARCH_X86
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
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 + */
93241711b635 sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents: 14730
diff changeset
22 +#define USE_MPLAYER_CPUDETECT
93241711b635 sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents: 14730
diff changeset
23 +
13864
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
24 static inline uint32_t arch_accel (void)
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
25 {
18730
93241711b635 sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents: 14730
diff changeset
26 +#if !defined(USE_MPLAYER_CPUDETECT)
13864
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
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;
26282
79ab4ecba54a Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents: 26047
diff changeset
30 @@ -105,7 +120,21 @@
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
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
32
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
33 return caps;
26283
62abac0c8637 cosmetics: Fix some typos and trailing whitespace in local changes.
diego
parents: 26282
diff changeset
34 +#else /* USE_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 +
93241711b635 sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents: 14730
diff changeset
47 +#endif /* USE_MPLAYER_CPUDETECT */
13020
3380d4a65b15 Patch updated for latest changes to libmpeg2.
diego
parents: 13019
diff changeset
48 }
13864
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
49 -#endif /* ARCH_X86 */
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
50 +#endif /* ARCH_X86 || ARCH_X86_64 */
13020
3380d4a65b15 Patch updated for latest changes to libmpeg2.
diego
parents: 13019
diff changeset
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)
79ab4ecba54a Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents: 26047
diff changeset
53 @@ -166,10 +168,10 @@
21377
6053051bdc75 add missing r15484
henry
parents: 20640
diff changeset
54
6053051bdc75 add missing r15484
henry
parents: 20640
diff changeset
55 canjump = 1;
6053051bdc75 add missing r15484
henry
parents: 20640
diff changeset
56
6053051bdc75 add missing r15484
henry
parents: 20640
diff changeset
57 -#ifdef HAVE_ALTIVEC_H /* gnu */
6053051bdc75 add missing r15484
henry
parents: 20640
diff changeset
58 -#define VAND(a,b,c) "vand " #a "," #b "," #c "\n\t"
6053051bdc75 add missing r15484
henry
parents: 20640
diff changeset
59 -#else /* apple */
25980
11181df06389 Do not check for __APPLE_ALTIVEC__, just check for __APPLE_CC__.
diego
parents: 24720
diff changeset
60 +#if defined(__APPLE_CC__) /* apple */
21377
6053051bdc75 add missing r15484
henry
parents: 20640
diff changeset
61 #define VAND(a,b,c) "vand v" #a ",v" #b ",v" #c "\n\t"
6053051bdc75 add missing r15484
henry
parents: 20640
diff changeset
62 +#else /* gnu */
6053051bdc75 add missing r15484
henry
parents: 20640
diff changeset
63 +#define VAND(a,b,c) "vand " #a "," #b "," #c "\n\t"
6053051bdc75 add missing r15484
henry
parents: 20640
diff changeset
64 #endif
6053051bdc75 add missing r15484
henry
parents: 20640
diff changeset
65 asm volatile ("mtspr 256, %0\n\t"
6053051bdc75 add missing r15484
henry
parents: 20640
diff changeset
66 VAND (0, 0, 0)
26282
79ab4ecba54a Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents: 26047
diff changeset
67 @@ -212,7 +241,7 @@
13864
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
68
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
69 accel = 0;
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
70 #ifdef ACCEL_DETECT
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
71 -#if defined (ARCH_X86) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC)
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
72 +#if defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC)
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
73 accel = arch_accel ();
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
74 #endif
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
75 #endif
19024
4733c3e4f353 Update with latest changes and make diff apply cleanly.
diego
parents: 18783
diff changeset
76 --- 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
77 +++ 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
78 @@ -29,14 +33,14 @@
13864
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
79 #include "mpeg2.h"
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
80 #include "attributes.h"
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
81 #include "mpeg2_internal.h"
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
82 -#ifdef ARCH_X86
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
83 +#if defined(ARCH_X86) || defined(ARCH_X86_64)
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
84 #include "mmx.h"
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
85 #endif
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
86
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
87 void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL;
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
88 void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL;
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
89
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
90 -#ifdef ARCH_X86
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
91 +#if defined(ARCH_X86) || defined(ARCH_X86_64)
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
92 static void state_restore_mmx (cpu_state_t * state)
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
93 {
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
94 emms ();
21571
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
95 @@ -48,18 +48,18 @@
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
96 #endif
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
97
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
98 -#ifdef ARCH_PPC
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
99 +#if defined(ARCH_PPC) && defined(HAVE_ALTIVEC)
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
100 -#ifdef HAVE_ALTIVEC_H /* gnu */
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
101 -#define LI(a,b) "li " #a "," #b "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
102 -#define STVX0(a,b,c) "stvx " #a ",0," #c "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
103 -#define STVX(a,b,c) "stvx " #a "," #b "," #c "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
104 -#define LVX0(a,b,c) "lvx " #a ",0," #c "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
105 -#define LVX(a,b,c) "lvx " #a "," #b "," #c "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
106 -#else /* apple */
25980
11181df06389 Do not check for __APPLE_ALTIVEC__, just check for __APPLE_CC__.
diego
parents: 24720
diff changeset
107 +#if defined(__APPLE_CC__) /* apple */
21571
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
108 #define LI(a,b) "li r" #a "," #b "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
109 #define STVX0(a,b,c) "stvx v" #a ",0,r" #c "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
110 #define STVX(a,b,c) "stvx v" #a ",r" #b ",r" #c "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
111 #define LVX0(a,b,c) "lvx v" #a ",0,r" #c "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
112 #define LVX(a,b,c) "lvx v" #a ",r" #b ",r" #c "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
113 +#else /* gnu */
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
114 +#define LI(a,b) "li " #a "," #b "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
115 +#define STVX0(a,b,c) "stvx " #a ",0," #c "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
116 +#define STVX(a,b,c) "stvx " #a "," #b "," #c "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
117 +#define LVX0(a,b,c) "lvx " #a ",0," #c "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
118 +#define LVX(a,b,c) "lvx " #a "," #b "," #c "\n\t"
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
119 #endif
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
120
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
121 static void state_save_altivec (cpu_state_t * state)
26282
79ab4ecba54a Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents: 26047
diff changeset
122 @@ -115,9 +119,9 @@
13864
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
123
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
124 void mpeg2_cpu_state_init (uint32_t accel)
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
125 {
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
126 -#ifdef ARCH_X86
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
127 +#if defined(ARCH_X86) || defined(ARCH_X86_64)
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
128 if (accel & MPEG2_ACCEL_X86_MMX) {
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
129 mpeg2_cpu_state_restore = state_restore_mmx;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
130 }
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
131 #endif
26282
79ab4ecba54a Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents: 26047
diff changeset
132 #ifdef ARCH_PPC
19024
4733c3e4f353 Update with latest changes and make diff apply cleanly.
diego
parents: 18783
diff changeset
133 --- 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
134 +++ 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
135 @@ -351,6 +355,15 @@
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
136 fbuf->buf[1] = buf[1];
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
137 fbuf->buf[2] = buf[2];
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
138 fbuf->id = id;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
139 + // HACK! FIXME! At first I frame, copy pointers to prediction frame too!
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
140 + if (mpeg2dec->custom_fbuf && !mpeg2dec->fbuf[1]->buf[0]){
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
141 + mpeg2dec->fbuf[1]->buf[0]=buf[0];
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
142 + mpeg2dec->fbuf[1]->buf[1]=buf[1];
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
143 + mpeg2dec->fbuf[1]->buf[2]=buf[2];
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
144 + mpeg2dec->fbuf[1]->id=NULL;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
145 + }
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
146 +// printf("libmpeg2: FBUF 0:%p 1:%p 2:%p\n",
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
147 +// mpeg2dec->fbuf[0]->buf[0],mpeg2dec->fbuf[1]->buf[0],mpeg2dec->fbuf[2]->buf[0]);
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
148 }
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
149
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
150 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
151 --- 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
152 +++ 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
153 @@ -100,6 +104,9 @@
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
154 mpeg2dec->decoder.convert = NULL;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
155 mpeg2dec->decoder.convert_id = NULL;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
156 mpeg2dec->picture = mpeg2dec->pictures;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
157 + memset(&mpeg2dec->fbuf_alloc[0].fbuf, 0, sizeof(mpeg2_fbuf_t));
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
158 + memset(&mpeg2dec->fbuf_alloc[1].fbuf, 0, sizeof(mpeg2_fbuf_t));
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
159 + memset(&mpeg2dec->fbuf_alloc[2].fbuf, 0, sizeof(mpeg2_fbuf_t));
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
160 mpeg2dec->fbuf[0] = &mpeg2dec->fbuf_alloc[0].fbuf;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
161 mpeg2dec->fbuf[1] = &mpeg2dec->fbuf_alloc[1].fbuf;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
162 mpeg2dec->fbuf[2] = &mpeg2dec->fbuf_alloc[2].fbuf;
19024
4733c3e4f353 Update with latest changes and make diff apply cleanly.
diego
parents: 18783
diff changeset
163 @@ -551,6 +558,7 @@
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
164 if (!(mpeg2dec->sequence.flags & SEQ_FLAG_PROGRESSIVE_SEQUENCE)) {
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
165 picture->nb_fields = (buffer[3] & 2) ? 3 : 2;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
166 flags |= (buffer[3] & 128) ? PIC_FLAG_TOP_FIELD_FIRST : 0;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
167 + flags |= (buffer[3] & 2) ? PIC_FLAG_REPEAT_FIRST_FIELD : 0;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
168 } else
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
169 picture->nb_fields = (buffer[3]&2) ? ((buffer[3]&128) ? 6 : 4) : 2;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
170 break;
19024
4733c3e4f353 Update with latest changes and make diff apply cleanly.
diego
parents: 18783
diff changeset
171 @@ -799,6 +807,7 @@
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
172 mpeg2dec->scaled[index] = mpeg2dec->q_scale_type;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
173 for (i = 0; i < 32; i++) {
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
174 k = mpeg2dec->q_scale_type ? non_linear_scale[i] : (i << 1);
13147
henry
parents: 13020
diff changeset
175 + decoder->quantizer_scales[i] = k;
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
176 for (j = 0; j < 64; j++)
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
177 decoder->quantizer_prescale[index][i][j] =
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
178 k * mpeg2dec->quantizer_matrix[index][j];
19024
4733c3e4f353 Update with latest changes and make diff apply cleanly.
diego
parents: 18783
diff changeset
179 --- 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
180 +++ 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
181 @@ -23,7 +27,7 @@
13864
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
182
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
183 #include "config.h"
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
184
13864
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
185 -#ifdef ARCH_X86
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
186 +#if defined(ARCH_X86) || defined(ARCH_X86_64)
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
187
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
188 #include <inttypes.h>
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
189
19024
4733c3e4f353 Update with latest changes and make diff apply cleanly.
diego
parents: 18783
diff changeset
190 --- 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
191 +++ libmpeg2/motion_comp.c 2006-06-16 20:12:50.000000000 +0200
26282
79ab4ecba54a Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents: 26047
diff changeset
192 @@ -67,6 +61,13 @@
23236
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
193 mpeg2_mc = mpeg2_mc_vis;
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
194 else
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
195 #endif
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
196 +#ifdef ARCH_ARM
26282
79ab4ecba54a Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents: 26047
diff changeset
197 + if (accel & MPEG2_ACCEL_ARM_IWMMXT)
79ab4ecba54a Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents: 26047
diff changeset
198 + mpeg2_mc = mpeg2_mc_iwmmxt;
79ab4ecba54a Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents: 26047
diff changeset
199 + else if (accel & MPEG2_ACCEL_ARM)
79ab4ecba54a Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents: 26047
diff changeset
200 + mpeg2_mc = mpeg2_mc_arm;
79ab4ecba54a Revert local changes that pointlessly add #ifdefs all over libmpeg2 to disable
diego
parents: 26047
diff changeset
201 + else
23236
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
202 +#endif
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
203 mpeg2_mc = mpeg2_mc_c;
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
204 }
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
205
19024
4733c3e4f353 Update with latest changes and make diff apply cleanly.
diego
parents: 18783
diff changeset
206 --- 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
207 +++ 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
208 @@ -23,7 +27,7 @@
13864
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
209
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
210 #include "config.h"
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
211
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
212 -#ifdef ARCH_X86
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
213 +#if defined(ARCH_X86) || defined(ARCH_X86_64)
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
214
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
215 #include <inttypes.h>
96259a2f2142 enable mmx support on x86_64 in libmpeg2
aurel
parents: 13147
diff changeset
216
19024
4733c3e4f353 Update with latest changes and make diff apply cleanly.
diego
parents: 18783
diff changeset
217 --- 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
218 +++ 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
219 @@ -82,6 +86,7 @@
13147
henry
parents: 13020
diff changeset
220 #define PIC_FLAG_COMPOSITE_DISPLAY 32
henry
parents: 13020
diff changeset
221 #define PIC_FLAG_SKIP 64
henry
parents: 13020
diff changeset
222 #define PIC_FLAG_TAGS 128
henry
parents: 13020
diff changeset
223 +#define PIC_FLAG_REPEAT_FIRST_FIELD 256
henry
parents: 13020
diff changeset
224 #define PIC_MASK_COMPOSITE_DISPLAY 0xfffff000
henry
parents: 13020
diff changeset
225
henry
parents: 13020
diff changeset
226 typedef struct mpeg2_picture_s {
26047
9153b0e6ab23 Remove mistakenly committed hunk.
diego
parents: 26046
diff changeset
227 @@ -156,10 +160,13 @@
18730
93241711b635 sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents: 14730
diff changeset
228 #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
229 #define MPEG2_ACCEL_X86_MMXEXT 4
26047
9153b0e6ab23 Remove mistakenly committed hunk.
diego
parents: 26046
diff changeset
230 +#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
231 #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
232 #define MPEG2_ACCEL_ALPHA 1
93241711b635 sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents: 14730
diff changeset
233 #define MPEG2_ACCEL_ALPHA_MVI 2
26046
b65b71ba0e16 Properly detect ARM mc acceleration.
diego
parents: 26044
diff changeset
234 #define MPEG2_ACCEL_SPARC_VIS 1
b65b71ba0e16 Properly detect ARM mc acceleration.
diego
parents: 26044
diff changeset
235 #define MPEG2_ACCEL_SPARC_VIS2 2
b65b71ba0e16 Properly detect ARM mc acceleration.
diego
parents: 26044
diff changeset
236 +#define MPEG2_ACCEL_ARM 1
b65b71ba0e16 Properly detect ARM mc acceleration.
diego
parents: 26044
diff changeset
237 +#define MPEG2_ACCEL_ARM_IWMMXT 2
b65b71ba0e16 Properly detect ARM mc acceleration.
diego
parents: 26044
diff changeset
238 #define MPEG2_ACCEL_DETECT 0x80000000
b65b71ba0e16 Properly detect ARM mc acceleration.
diego
parents: 26044
diff changeset
239
b65b71ba0e16 Properly detect ARM mc acceleration.
diego
parents: 26044
diff changeset
240 uint32_t mpeg2_accel (uint32_t accel);
19024
4733c3e4f353 Update with latest changes and make diff apply cleanly.
diego
parents: 18783
diff changeset
241 --- 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
242 +++ libmpeg2/mpeg2_internal.h 2006-06-16 20:12:50.000000000 +0200
26284
c5cd2eedc579 Remove pointless comments from local diff.
diego
parents: 26283
diff changeset
243 @@ -144,6 +148,11 @@
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
244 int second_field;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
245
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
246 int mpeg1;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
247 +
13147
henry
parents: 13020
diff changeset
248 + int quantizer_scales[32];
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
249 + int quantizer_scale;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
250 + char* quant_store;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
251 + int quant_stride;
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
252 };
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
253
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
254 typedef struct {
26284
c5cd2eedc579 Remove pointless comments from local diff.
diego
parents: 26283
diff changeset
255 @@ -214,6 +224,9 @@
13147
henry
parents: 13020
diff changeset
256 int8_t q_scale_type, scaled[4];
henry
parents: 13020
diff changeset
257 uint8_t quantizer_matrix[4][64];
henry
parents: 13020
diff changeset
258 uint8_t new_quantizer_matrix[4][64];
henry
parents: 13020
diff changeset
259 +
henry
parents: 13020
diff changeset
260 + unsigned char *pending_buffer;
henry
parents: 13020
diff changeset
261 + int pending_length;
henry
parents: 13020
diff changeset
262 };
henry
parents: 13020
diff changeset
263
henry
parents: 13020
diff changeset
264 typedef struct {
23236
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
265 @@ -312,3 +312,5 @@
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
266 extern mpeg2_mc_t mpeg2_mc_altivec;
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
267 extern mpeg2_mc_t mpeg2_mc_alpha;
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
268 extern mpeg2_mc_t mpeg2_mc_vis;
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
269 +extern mpeg2_mc_t mpeg2_mc_arm;
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
270 +extern mpeg2_mc_t mpeg2_mc_iwmmxt;
19024
4733c3e4f353 Update with latest changes and make diff apply cleanly.
diego
parents: 18783
diff changeset
271 --- 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
272 +++ 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
273 @@ -142,6 +146,7 @@
13147
henry
parents: 13020
diff changeset
274
henry
parents: 13020
diff changeset
275 quantizer_scale_code = UBITS (bit_buf, 5);
henry
parents: 13020
diff changeset
276 DUMPBITS (bit_buf, bits, 5);
henry
parents: 13020
diff changeset
277 + decoder->quantizer_scale = decoder->quantizer_scales[quantizer_scale_code];
henry
parents: 13020
diff changeset
278
henry
parents: 13020
diff changeset
279 decoder->quantizer_matrix[0] =
henry
parents: 13020
diff changeset
280 decoder->quantizer_prescale[0][quantizer_scale_code];
20640
c52bb8d6edea update for r20654
henry
parents: 19259
diff changeset
281 @@ -1568,6 +1569,18 @@
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
282
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
283 #define NEXT_MACROBLOCK \
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
284 do { \
20640
c52bb8d6edea update for r20654
henry
parents: 19259
diff changeset
285 + if(decoder->quant_store) { \
c52bb8d6edea update for r20654
henry
parents: 19259
diff changeset
286 + if (decoder->picture_structure == TOP_FIELD) \
c52bb8d6edea update for r20654
henry
parents: 19259
diff changeset
287 + decoder->quant_store[2*decoder->quant_stride*(decoder->v_offset>>4) \
c52bb8d6edea update for r20654
henry
parents: 19259
diff changeset
288 + +(decoder->offset>>4)] = decoder->quantizer_scale; \
c52bb8d6edea update for r20654
henry
parents: 19259
diff changeset
289 + else if (decoder->picture_structure == BOTTOM_FIELD) \
c52bb8d6edea update for r20654
henry
parents: 19259
diff changeset
290 + decoder->quant_store[2*decoder->quant_stride*(decoder->v_offset>>4) \
c52bb8d6edea update for r20654
henry
parents: 19259
diff changeset
291 + + decoder->quant_stride \
c52bb8d6edea update for r20654
henry
parents: 19259
diff changeset
292 + +(decoder->offset>>4)] = decoder->quantizer_scale; \
c52bb8d6edea update for r20654
henry
parents: 19259
diff changeset
293 + else \
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
294 + decoder->quant_store[decoder->quant_stride*(decoder->v_offset>>4) \
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
295 + +(decoder->offset>>4)] = decoder->quantizer_scale; \
20640
c52bb8d6edea update for r20654
henry
parents: 19259
diff changeset
296 + } \
12937
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
297 decoder->offset += 16; \
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
298 if (decoder->offset == decoder->width) { \
b61f21a54546 summary of the MPlayer specific libmpeg2 changes
henry
parents:
diff changeset
299 do { /* just so we can use the break statement */ \
21923
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
300 @@ -1604,6 +1604,12 @@
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
301 } \
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
302 } while (0)
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
303
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
304 +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
305 + motion_t * const motion,
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
306 + mpeg2_mc_fct * const * const table)
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
307 +{
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
308 +}
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
309 +
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
310 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
311 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
312 {
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
313 @@ -1661,7 +1667,9 @@
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
314
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
315 if (decoder->mpeg1) {
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
316 decoder->motion_parser[0] = motion_zero_420;
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
317 + decoder->motion_parser[MC_FIELD] = motion_dummy;
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
318 decoder->motion_parser[MC_FRAME] = motion_mp1;
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
319 + decoder->motion_parser[MC_DMV] = motion_dummy;
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
320 decoder->motion_parser[4] = motion_reuse_420;
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
321 } else if (decoder->picture_structure == FRAME_PICTURE) {
1658f7d97b27 fix crash with http://sam.zoy.org/zzuf/lol-mplayer.m2v
henry
parents: 21571
diff changeset
322 if (decoder->chroma_format == 0) {
21571
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
323 --- libmpeg2/idct_altivec.c 2004/08/02 11:26:43 12933
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
324 +++ libmpeg2/idct_altivec.c 2005/05/15 20:11:34 15484
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
325 @@ -41,7 +41,7 @@
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
326 typedef vector signed int vector_s32_t;
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
327 typedef vector unsigned int vector_u32_t;
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
328
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
329 -#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
330 +#if defined(HAVE_ALTIVEC_H) && !defined(__APPLE_CC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 303)
21571
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
331 /* work around gcc <3.3 vec_mergel bug */
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
332 static inline vector_s16_t my_vec_mergel (vector_s16_t const A,
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
333 vector_s16_t const B)
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
334 @@ -56,10 +56,10 @@
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
335 #define vec_mergel my_vec_mergel
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
336 #endif
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
337
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
338 -#ifdef HAVE_ALTIVEC_H /* gnu */
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
339 -#define VEC_S16(a,b,c,d,e,f,g,h) {a, b, c, d, e, f, g, h}
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
340 -#else /* apple */
25980
11181df06389 Do not check for __APPLE_ALTIVEC__, just check for __APPLE_CC__.
diego
parents: 24720
diff changeset
341 +#if defined(__APPLE_CC__) /* apple */
21571
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
342 #define VEC_S16(a,b,c,d,e,f,g,h) (vector_s16_t) (a, b, c, d, e, f, g, h)
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
343 +#else /* gnu */
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
344 +#define VEC_S16(a,b,c,d,e,f,g,h) {a, b, c, d, e, f, g, h}
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
345 #endif
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
346
f6881c789312 (hopefully) the rest of PPC modifications
henry
parents: 21534
diff changeset
347 static const vector_s16_t constants ATTR_ALIGN(16) =
23236
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
348 Index: libmpeg2/motion_comp_arm.c
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
349 ===================================================================
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
350 --- libmpeg2/motion_comp_arm.c (revision 0)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
351 +++ libmpeg2/motion_comp_arm.c (revision 0)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
352 @@ -0,0 +1,187 @@
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
353 +/*
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
354 + * motion_comp_arm.c
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
355 + * 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
356 + *
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
357 + * 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
358 + * See http://libmpeg2.sourceforge.net/ for updates.
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
359 + *
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
360 + * 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
361 + * 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
362 + * 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
363 + * (at your option) any later version.
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
364 + *
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
365 + * 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
366 + * 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
367 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
368 + * GNU General Public License for more details.
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
369 + *
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
370 + * 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
371 + * 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
372 + * 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
373 + */
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
374 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
375 +#include "config.h"
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
376 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
377 +#ifdef ARCH_ARM
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
378 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
379 +#include <inttypes.h>
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
380 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
381 +#include "mpeg2.h"
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
382 +#include "attributes.h"
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
383 +#include "mpeg2_internal.h"
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
384 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
385 +#define avg2(a,b) ((a+b+1)>>1)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
386 +#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
387 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
388 +#define predict_o(i) (ref[i])
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
389 +#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
390 +#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
391 +#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
392 + (ref+stride)[i], (ref+stride)[i+1]))
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
393 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
394 +#define put(predictor,i) dest[i] = predictor (i)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
395 +#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
396 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
397 +/* mc function template */
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
398 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
399 +#define MC_FUNC(op,xy) \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
400 +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
401 + const int stride, int height) \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
402 +{ \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
403 + do { \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
404 + op (predict_##xy, 0); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
405 + op (predict_##xy, 1); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
406 + op (predict_##xy, 2); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
407 + op (predict_##xy, 3); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
408 + op (predict_##xy, 4); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
409 + op (predict_##xy, 5); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
410 + op (predict_##xy, 6); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
411 + op (predict_##xy, 7); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
412 + op (predict_##xy, 8); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
413 + op (predict_##xy, 9); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
414 + op (predict_##xy, 10); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
415 + op (predict_##xy, 11); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
416 + op (predict_##xy, 12); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
417 + op (predict_##xy, 13); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
418 + op (predict_##xy, 14); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
419 + op (predict_##xy, 15); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
420 + ref += stride; \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
421 + dest += stride; \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
422 + } while (--height); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
423 +} \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
424 +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
425 + const int stride, int height) \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
426 +{ \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
427 + do { \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
428 + op (predict_##xy, 0); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
429 + op (predict_##xy, 1); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
430 + op (predict_##xy, 2); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
431 + op (predict_##xy, 3); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
432 + op (predict_##xy, 4); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
433 + op (predict_##xy, 5); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
434 + op (predict_##xy, 6); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
435 + op (predict_##xy, 7); \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
436 + ref += stride; \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
437 + dest += stride; \
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
438 + } while (--height); \
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 +/* definitions of the actual mc functions */
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
441 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
442 +MC_FUNC (put,o)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
443 +MC_FUNC (avg,o)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
444 +MC_FUNC (put,x)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
445 +MC_FUNC (avg,x)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
446 +MC_FUNC (put,y)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
447 +MC_FUNC (avg,y)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
448 +MC_FUNC (put,xy)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
449 +MC_FUNC (avg,xy)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
450 +
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 +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
453 + int stride, int height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
454 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
455 +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
456 + 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 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
459 +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
460 + int stride, int height)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
461 +{
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
462 + MC_put_y_16_c(dest, ref, stride, height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
463 +}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
464 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
465 +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
466 + int stride, int height)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
467 +{
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
468 + MC_put_xy_16_c(dest, ref, stride, height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
469 +}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
470 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
471 +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
472 + int stride, int height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
473 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
474 +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
475 + int stride, int height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
476 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
477 +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
478 + int stride, int height)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
479 +{
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
480 + MC_put_y_8_c(dest, ref, stride, 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 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
483 +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
484 + int stride, int height)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
485 +{
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
486 + MC_put_xy_8_c(dest, ref, stride, height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
487 +}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
488 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
489 +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
490 + int stride, int height)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
491 +{
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
492 + MC_avg_o_16_c(dest, ref, stride, height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
493 +}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
494 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
495 +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
496 + int stride, int height)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
497 +{
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
498 + MC_avg_x_16_c(dest, ref, stride, height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
499 +}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
500 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
501 +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
502 + int stride, int height)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
503 +{
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
504 + MC_avg_y_16_c(dest, ref, stride, height);
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 +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
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 + MC_avg_xy_16_c(dest, ref, stride, height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
511 +}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
512 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
513 +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
514 + int stride, int height)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
515 +{
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
516 + MC_avg_o_8_c(dest, ref, stride, height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
517 +}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
518 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
519 +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
520 + int stride, int height)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
521 +{
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
522 + MC_avg_x_8_c(dest, ref, stride, height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
523 +}
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 +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
526 + int stride, int height)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
527 +{
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
528 + MC_avg_y_8_c(dest, ref, stride, height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
529 +}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
530 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
531 +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
532 + int stride, int height)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
533 +{
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
534 + MC_avg_xy_8_c(dest, ref, stride, height);
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
535 +}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
536 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
537 +MPEG2_MC_EXTERN (arm)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
538 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
539 +#endif
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
540 Index: libmpeg2/motion_comp_arm_s.S
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
541 ===================================================================
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
542 --- libmpeg2/motion_comp_arm_s.S (revision 0)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
543 +++ libmpeg2/motion_comp_arm_s.S (revision 0)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
544 @@ -0,0 +1,322 @@
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
545 +@ motion_comp_arm_s.S
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
546 +@ 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
547 +@
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
548 +@ 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
549 +@ See http://libmpeg2.sourceforge.net/ for updates.
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
550 +@
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
551 +@ 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
552 +@ 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
553 +@ 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
554 +@ (at your option) any later version.
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 +@ 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
557 +@ 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
558 +@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
559 +@ GNU General Public License for more details.
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 +@ 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
562 +@ 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
563 +@ 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
564 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
565 + .text
26283
62abac0c8637 cosmetics: Fix some typos and trailing whitespace in local changes.
diego
parents: 26282
diff changeset
566 +
23236
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 + .align
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
569 + .global MC_put_o_16_arm
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
570 +MC_put_o_16_arm:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
571 + @@ 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
572 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
573 + 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
574 + and r4, r1, #3
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
575 + adr r5, MC_put_o_16_arm_align_jt
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
576 + add r5, r5, r4, lsl #2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
577 + ldr pc, [r5]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
578 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
579 +MC_put_o_16_arm_align0:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
580 + ldmia r1, {r4-r7}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
581 + add r1, r1, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
582 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
583 + stmia r0, {r4-r7}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
584 + subs r3, r3, #1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
585 + add r0, r0, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
586 + bne MC_put_o_16_arm_align0
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
587 + 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
588 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
589 +.macro PROC shift
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
590 + ldmia r1, {r4-r8}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
591 + add r1, r1, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
592 + mov r9, r4, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
593 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
594 + mov r10, r5, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
595 + orr r9, r9, r5, lsl #(32-\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
596 + mov r11, r6, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
597 + orr r10, r10, r6, lsl #(32-\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
598 + mov r12, r7, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
599 + orr r11, r11, r7, lsl #(32-\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
600 + orr r12, r12, r8, lsl #(32-\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
601 + stmia r0, {r9-r12}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
602 + subs r3, r3, #1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
603 + add r0, r0, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
604 +.endm
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 +MC_put_o_16_arm_align1:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
607 + and r1, r1, #0xFFFFFFFC
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
608 +1: PROC(8)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
609 + bne 1b
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
610 + 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
611 +MC_put_o_16_arm_align2:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
612 + and r1, r1, #0xFFFFFFFC
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
613 +1: PROC(16)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
614 + bne 1b
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
615 + 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
616 +MC_put_o_16_arm_align3:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
617 + and r1, r1, #0xFFFFFFFC
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
618 +1: PROC(24)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
619 + bne 1b
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
620 + 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
621 +MC_put_o_16_arm_align_jt:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
622 + .word MC_put_o_16_arm_align0
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
623 + .word MC_put_o_16_arm_align1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
624 + .word MC_put_o_16_arm_align2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
625 + .word MC_put_o_16_arm_align3
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
626 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
627 +@ ----------------------------------------------------------------
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
628 + .align
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
629 + .global MC_put_o_8_arm
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
630 +MC_put_o_8_arm:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
631 + @@ 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
632 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
633 + 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
634 + and r4, r1, #3
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
635 + adr r5, MC_put_o_8_arm_align_jt
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
636 + add r5, r5, r4, lsl #2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
637 + ldr pc, [r5]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
638 +MC_put_o_8_arm_align0:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
639 + ldmia r1, {r4-r5}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
640 + add r1, r1, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
641 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
642 + stmia r0, {r4-r5}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
643 + add r0, r0, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
644 + subs r3, r3, #1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
645 + bne MC_put_o_8_arm_align0
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
646 + 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
647 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
648 +.macro PROC8 shift
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
649 + ldmia r1, {r4-r6}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
650 + add r1, r1, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
651 + mov r9, r4, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
652 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
653 + mov r10, r5, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
654 + orr r9, r9, r5, lsl #(32-\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
655 + orr r10, r10, r6, lsl #(32-\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
656 + stmia r0, {r9-r10}
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_8_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: PROC8(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-r10, pc} @@ update PC with LR content.
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
666 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
667 +MC_put_o_8_arm_align2:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
668 + and r1, r1, #0xFFFFFFFC
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
669 +1: PROC8(16)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
670 + bne 1b
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
671 + 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
672 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
673 +MC_put_o_8_arm_align3:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
674 + and r1, r1, #0xFFFFFFFC
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
675 +1: PROC8(24)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
676 + bne 1b
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
677 + 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
678 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
679 +MC_put_o_8_arm_align_jt:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
680 + .word MC_put_o_8_arm_align0
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
681 + .word MC_put_o_8_arm_align1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
682 + .word MC_put_o_8_arm_align2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
683 + .word MC_put_o_8_arm_align3
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
684 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
685 +@ ----------------------------------------------------------------
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
686 +.macro AVG_PW rW1, rW2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
687 + mov \rW2, \rW2, lsl #24
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
688 + orr \rW2, \rW2, \rW1, lsr #8
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
689 + eor r9, \rW1, \rW2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
690 + and \rW2, \rW1, \rW2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
691 + and r10, r9, r12
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
692 + add \rW2, \rW2, r10, lsr #1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
693 + and r10, r9, r11
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
694 + add \rW2, \rW2, r10
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
695 +.endm
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
696 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
697 + .align
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
698 + .global MC_put_x_16_arm
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
699 +MC_put_x_16_arm:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
700 + @@ 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
701 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
702 + 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
703 + and r4, r1, #3
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
704 + adr r5, MC_put_x_16_arm_align_jt
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
705 + ldr r11, [r5]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
706 + mvn r12, r11
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
707 + add r5, r5, r4, lsl #2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
708 + ldr pc, [r5, #4]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
709 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
710 +.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
711 + mov \R0, \R0, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
712 + orr \R0, \R0, \R1, lsl #(32 - \shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
713 + mov \R1, \R1, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
714 + orr \R1, \R1, \R2, lsl #(32 - \shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
715 + mov \R2, \R2, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
716 + orr \R2, \R2, \R3, lsl #(32 - \shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
717 + mov \R3, \R3, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
718 + orr \R3, \R3, \R4, lsl #(32 - \shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
719 + mov \R4, \R4, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
720 +@ and \R4, \R4, #0xFF
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
721 +.endm
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
722 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
723 +MC_put_x_16_arm_align0:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
724 + ldmia r1, {r4-r8}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
725 + add r1, r1, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
726 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
727 + AVG_PW r7, r8
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
728 + AVG_PW r6, r7
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
729 + AVG_PW r5, r6
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
730 + AVG_PW r4, r5
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
731 + stmia r0, {r5-r8}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
732 + subs r3, r3, #1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
733 + add r0, r0, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
734 + bne MC_put_x_16_arm_align0
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
735 + 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
736 +MC_put_x_16_arm_align1:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
737 + and r1, r1, #0xFFFFFFFC
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
738 +1: ldmia r1, {r4-r8}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
739 + add r1, r1, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
740 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
741 + ADJ_ALIGN_QW 8, r4, r5, r6, r7, r8
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
742 + AVG_PW r7, r8
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
743 + AVG_PW r6, r7
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
744 + AVG_PW r5, r6
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
745 + AVG_PW r4, r5
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
746 + stmia r0, {r5-r8}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
747 + subs r3, r3, #1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
748 + add r0, r0, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
749 + bne 1b
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
750 + 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
751 +MC_put_x_16_arm_align2:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
752 + and r1, r1, #0xFFFFFFFC
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
753 +1: ldmia r1, {r4-r8}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
754 + add r1, r1, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
755 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
756 + ADJ_ALIGN_QW 16, r4, r5, r6, r7, r8
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
757 + AVG_PW r7, r8
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
758 + AVG_PW r6, r7
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
759 + AVG_PW r5, r6
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
760 + AVG_PW r4, r5
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
761 + stmia r0, {r5-r8}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
762 + subs r3, r3, #1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
763 + add r0, r0, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
764 + bne 1b
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
765 + 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
766 +MC_put_x_16_arm_align3:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
767 + and r1, r1, #0xFFFFFFFC
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
768 +1: ldmia r1, {r4-r8}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
769 + add r1, r1, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
770 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
771 + ADJ_ALIGN_QW 24, r4, r5, r6, r7, r8
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
772 + AVG_PW r7, r8
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
773 + AVG_PW r6, r7
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
774 + AVG_PW r5, r6
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
775 + AVG_PW r4, r5
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
776 + stmia r0, {r5-r8}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
777 + subs r3, r3, #1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
778 + add r0, r0, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
779 + bne 1b
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
780 + 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
781 +MC_put_x_16_arm_align_jt:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
782 + .word 0x01010101
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
783 + .word MC_put_x_16_arm_align0
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
784 + .word MC_put_x_16_arm_align1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
785 + .word MC_put_x_16_arm_align2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
786 + .word MC_put_x_16_arm_align3
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
787 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
788 +@ ----------------------------------------------------------------
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
789 + .align
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
790 + .global MC_put_x_8_arm
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
791 +MC_put_x_8_arm:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
792 + @@ 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
793 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
794 + 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
795 + and r4, r1, #3
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
796 + adr r5, MC_put_x_8_arm_align_jt
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
797 + ldr r11, [r5]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
798 + mvn r12, r11
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
799 + add r5, r5, r4, lsl #2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
800 + ldr pc, [r5, #4]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
801 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
802 +.macro ADJ_ALIGN_DW shift, R0, R1, R2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
803 + mov \R0, \R0, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
804 + orr \R0, \R0, \R1, lsl #(32 - \shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
805 + mov \R1, \R1, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
806 + orr \R1, \R1, \R2, lsl #(32 - \shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
807 + mov \R2, \R2, lsr #(\shift)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
808 +@ and \R4, \R4, #0xFF
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
809 +.endm
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
810 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
811 +MC_put_x_8_arm_align0:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
812 + ldmia r1, {r4-r6}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
813 + add r1, r1, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
814 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
815 + AVG_PW r5, r6
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
816 + AVG_PW r4, r5
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
817 + stmia r0, {r5-r6}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
818 + subs r3, r3, #1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
819 + add r0, r0, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
820 + bne MC_put_x_8_arm_align0
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
821 + 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
822 +MC_put_x_8_arm_align1:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
823 + and r1, r1, #0xFFFFFFFC
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
824 +1: ldmia r1, {r4-r6}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
825 + add r1, r1, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
826 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
827 + ADJ_ALIGN_DW 8, r4, r5, r6
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
828 + AVG_PW r5, r6
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
829 + AVG_PW r4, r5
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
830 + stmia r0, {r5-r6}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
831 + subs r3, r3, #1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
832 + add r0, r0, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
833 + bne 1b
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
834 + 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
835 +MC_put_x_8_arm_align2:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
836 + and r1, r1, #0xFFFFFFFC
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
837 +1: ldmia r1, {r4-r6}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
838 + add r1, r1, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
839 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
840 + ADJ_ALIGN_DW 16, r4, r5, r6
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
841 + AVG_PW r5, r6
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
842 + AVG_PW r4, r5
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
843 + stmia r0, {r5-r6}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
844 + subs r3, r3, #1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
845 + add r0, r0, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
846 + bne 1b
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
847 + 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
848 +MC_put_x_8_arm_align3:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
849 + and r1, r1, #0xFFFFFFFC
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
850 +1: ldmia r1, {r4-r6}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
851 + add r1, r1, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
852 + pld [r1]
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
853 + ADJ_ALIGN_DW 24, r4, r5, r6
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
854 + AVG_PW r5, r6
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
855 + AVG_PW r4, r5
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
856 + stmia r0, {r5-r6}
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
857 + subs r3, r3, #1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
858 + add r0, r0, r2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
859 + bne 1b
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
860 + 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
861 +MC_put_x_8_arm_align_jt:
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
862 + .word 0x01010101
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
863 + .word MC_put_x_8_arm_align0
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
864 + .word MC_put_x_8_arm_align1
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
865 + .word MC_put_x_8_arm_align2
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
866 + .word MC_put_x_8_arm_align3
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
867 Index: libmpeg2/motion_comp_iwmmxt.c
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
868 ===================================================================
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
869 --- libmpeg2/motion_comp_iwmmxt.c (revision 0)
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
870 +++ libmpeg2/motion_comp_iwmmxt.c (revision 0)
26044
7a541b991b85 Merge two #ifdefs into one.
diego
parents: 26043
diff changeset
871 @@ -0,0 +1,59 @@
23236
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
872 +/*
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
873 + * motion_comp_iwmmxt.c
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
874 + * 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
875 + *
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
876 + * 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
877 + * See http://libmpeg2.sourceforge.net/ for updates.
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
878 + *
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
879 + * 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
880 + * 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
881 + * 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
882 + * (at your option) any later version.
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
883 + *
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
884 + * 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
885 + * 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
886 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
887 + * GNU General Public License for more details.
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
888 + *
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
889 + * 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
890 + * 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
891 + * 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
892 + */
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
893 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
894 +#include "config.h"
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
895 +
26044
7a541b991b85 Merge two #ifdefs into one.
diego
parents: 26043
diff changeset
896 +#if defined(ARCH_ARM) && defined(HAVE_IWMMXT)
23236
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
897 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
898 +#include <inttypes.h>
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
899 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
900 +#include "mpeg2.h"
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
901 +#include "attributes.h"
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
902 +#include "mpeg2_internal.h"
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
903 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
904 +/* defined in libavcodec */
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
905 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
906 +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
907 +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
908 +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
909 +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
910 +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
911 +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
912 +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
913 +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
914 +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
915 +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
916 +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
917 +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
918 +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
919 +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
920 +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
921 +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
922 +
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
923 +mpeg2_mc_t mpeg2_mc_iwmmxt = {
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
924 + {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
925 + 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
926 + {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
927 + 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
928 +};
f0ddd02aec27 iWMMXt-accelerated DCT and motion compensation for ARM processors
gpoirier
parents: 21923
diff changeset
929 +
26044
7a541b991b85 Merge two #ifdefs into one.
diego
parents: 26043
diff changeset
930 +#endif /* defined(ARCH_ARM) && defined(HAVE_IWMMXT) */