Mercurial > mplayer.hg
annotate libmpeg2/libmpeg-0.4.0.diff @ 19024:4733c3e4f353
Update with latest changes and make diff apply cleanly.
| author | diego |
|---|---|
| date | Wed, 12 Jul 2006 14:00:04 +0000 |
| parents | 0783dd397f74 |
| children | de3edca9a962 |
| rev | line source |
|---|---|
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
1 --- include/attributes.h 2006-06-16 20:12:26.000000000 +0200 |
|
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
2 +++ libmpeg2/attributes.h 2006-06-16 20:12:50.000000000 +0200 |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
3 @@ -25,7 +29,7 @@ |
| 13147 | 4 #ifdef ATTRIBUTE_ALIGNED_MAX |
| 5 #define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align))) | |
| 6 #else | |
| 7 -#define ATTR_ALIGN(align) | |
| 8 +#define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((16 < align) ? 16 : align))) | |
| 9 #endif | |
| 10 | |
| 11 #ifdef HAVE_BUILTIN_EXPECT | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
12 --- libmpeg2/cpu_accel.c 2006-06-16 20:12:26.000000000 +0200 |
|
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
13 +++ libmpeg2/cpu_accel.c 2006-06-16 20:12:50.000000000 +0200 |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
14 @@ -19,9 +19,14 @@ |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
15 * You should have received a copy of the GNU General Public License |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
16 * along with this program; if not, write to the Free Software |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
18 + * |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
19 + * Modified for use with MPlayer, see libmpeg-0.4.0.diff for the exact changes. |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
20 + * detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ |
|
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
21 + * $Id$ |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
22 */ |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
23 |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
24 #include "config.h" |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
25 +#include "cpudetect.h" |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
26 |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
27 #include <inttypes.h> |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
28 |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
29 @@ -30,9 +35,17 @@ |
| 13864 | 30 #include "mpeg2_internal.h" |
| 31 | |
| 32 #ifdef ACCEL_DETECT | |
| 33 -#ifdef ARCH_X86 | |
| 34 +#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
|
35 + |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
36 +/* MPlayer imports libmpeg2 as decoder, which detects MMX / 3DNow! |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
37 + * instructions via assembly. However, it is regarded as duplicaed work |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
38 + * in MPlayer, so that we enforce to use MPlayer's implementation. |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
39 + */ |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
40 +#define USE_MPLAYER_CPUDETECT |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
41 + |
| 13864 | 42 static inline uint32_t arch_accel (void) |
| 43 { | |
|
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
44 +#if !defined(USE_MPLAYER_CPUDETECT) |
| 13864 | 45 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
|
46 int AMD; |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
47 uint32_t caps; |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
48 @@ -105,10 +118,24 @@ |
|
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
49 caps |= MPEG2_ACCEL_X86_MMXEXT; |
| 13864 | 50 |
| 51 return caps; | |
|
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
52 +#else /* USE_MPLAYER_CPUDETECT: Use MPlayer's cpu capability property */ |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
53 + caps = 0; |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
54 + if (gCpuCaps.hasMMX) |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
55 + caps |= MPEG2_ACCEL_X86_MMX; |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
56 + if (gCpuCaps.hasSSE2) |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
57 + caps |= MPEG2_ACCEL_X86_SSE2; |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
58 + if (gCpuCaps.hasMMX2) |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
59 + caps |= MPEG2_ACCEL_X86_MMXEXT; |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
60 + if (gCpuCaps.has3DNow) |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
61 + caps |= MPEG2_ACCEL_X86_3DNOW; |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
62 + |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
63 + return caps; |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
64 + |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
65 +#endif /* USE_MPLAYER_CPUDETECT */ |
| 13020 | 66 } |
| 13864 | 67 -#endif /* ARCH_X86 */ |
| 68 +#endif /* ARCH_X86 || ARCH_X86_64 */ | |
| 13020 | 69 |
| 70 -#if defined(ARCH_PPC) || defined(ARCH_SPARC) | |
| 71 +#if defined(ARCH_PPC) || (defined(ARCH_SPARC) && defined(HAVE_VIS)) | |
| 72 #include <signal.h> | |
| 73 #include <setjmp.h> | |
| 74 | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
75 @@ -195,6 +222,7 @@ |
| 12937 | 76 #ifdef ARCH_ALPHA |
| 77 static inline uint32_t arch_accel (void) | |
| 78 { | |
| 79 +#ifdef CAN_COMPILE_ALPHA_MVI | |
| 80 uint64_t no_mvi; | |
| 81 | |
| 82 asm volatile ("amask %1, %0" | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
83 @@ -202,6 +230,9 @@ |
| 12937 | 84 : "rI" (256)); /* AMASK_MVI */ |
| 85 return no_mvi ? MPEG2_ACCEL_ALPHA : (MPEG2_ACCEL_ALPHA | | |
| 86 MPEG2_ACCEL_ALPHA_MVI); | |
| 87 +#else | |
| 88 + return MPEG2_ACCEL_ALPHA; | |
| 89 +#endif | |
| 90 } | |
| 91 #endif /* ARCH_ALPHA */ | |
| 92 #endif /* ACCEL_DETECT */ | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
93 @@ -212,7 +243,7 @@ |
| 13864 | 94 |
| 95 accel = 0; | |
| 96 #ifdef ACCEL_DETECT | |
| 97 -#if defined (ARCH_X86) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC) | |
| 98 +#if defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC) | |
| 99 accel = arch_accel (); | |
| 100 #endif | |
| 101 #endif | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
102 --- 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
|
103 +++ 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
|
104 @@ -29,14 +33,14 @@ |
| 13864 | 105 #include "mpeg2.h" |
| 106 #include "attributes.h" | |
| 107 #include "mpeg2_internal.h" | |
| 108 -#ifdef ARCH_X86 | |
| 109 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
| 110 #include "mmx.h" | |
| 111 #endif | |
| 112 | |
| 113 void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL; | |
| 114 void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL; | |
| 115 | |
| 116 -#ifdef ARCH_X86 | |
| 117 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
| 118 static void state_restore_mmx (cpu_state_t * state) | |
| 119 { | |
| 120 emms (); | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
121 @@ -115,12 +119,12 @@ |
| 13864 | 122 |
| 123 void mpeg2_cpu_state_init (uint32_t accel) | |
| 124 { | |
| 125 -#ifdef ARCH_X86 | |
| 126 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
| 127 if (accel & MPEG2_ACCEL_X86_MMX) { | |
| 12937 | 128 mpeg2_cpu_state_restore = state_restore_mmx; |
| 129 } | |
| 130 #endif | |
| 131 -#ifdef ARCH_PPC | |
| 132 +#if defined(ARCH_PPC) && defined(HAVE_ALTIVEC) | |
| 133 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) { | |
| 134 mpeg2_cpu_state_save = state_save_altivec; | |
| 135 mpeg2_cpu_state_restore = state_restore_altivec; | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
136 --- 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
|
137 +++ 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
|
138 @@ -351,6 +355,15 @@ |
| 12937 | 139 fbuf->buf[1] = buf[1]; |
| 140 fbuf->buf[2] = buf[2]; | |
| 141 fbuf->id = id; | |
| 142 + // HACK! FIXME! At first I frame, copy pointers to prediction frame too! | |
| 143 + if (mpeg2dec->custom_fbuf && !mpeg2dec->fbuf[1]->buf[0]){ | |
| 144 + mpeg2dec->fbuf[1]->buf[0]=buf[0]; | |
| 145 + mpeg2dec->fbuf[1]->buf[1]=buf[1]; | |
| 146 + mpeg2dec->fbuf[1]->buf[2]=buf[2]; | |
| 147 + mpeg2dec->fbuf[1]->id=NULL; | |
| 148 + } | |
| 149 +// printf("libmpeg2: FBUF 0:%p 1:%p 2:%p\n", | |
| 150 +// mpeg2dec->fbuf[0]->buf[0],mpeg2dec->fbuf[1]->buf[0],mpeg2dec->fbuf[2]->buf[0]); | |
| 151 } | |
| 152 | |
| 153 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
|
154 --- 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
|
155 +++ 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
|
156 @@ -100,6 +104,9 @@ |
| 12937 | 157 mpeg2dec->decoder.convert = NULL; |
| 158 mpeg2dec->decoder.convert_id = NULL; | |
| 159 mpeg2dec->picture = mpeg2dec->pictures; | |
| 160 + memset(&mpeg2dec->fbuf_alloc[0].fbuf, 0, sizeof(mpeg2_fbuf_t)); | |
| 161 + memset(&mpeg2dec->fbuf_alloc[1].fbuf, 0, sizeof(mpeg2_fbuf_t)); | |
| 162 + memset(&mpeg2dec->fbuf_alloc[2].fbuf, 0, sizeof(mpeg2_fbuf_t)); | |
| 163 mpeg2dec->fbuf[0] = &mpeg2dec->fbuf_alloc[0].fbuf; | |
| 164 mpeg2dec->fbuf[1] = &mpeg2dec->fbuf_alloc[1].fbuf; | |
| 165 mpeg2dec->fbuf[2] = &mpeg2dec->fbuf_alloc[2].fbuf; | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
166 @@ -551,6 +558,7 @@ |
| 12937 | 167 if (!(mpeg2dec->sequence.flags & SEQ_FLAG_PROGRESSIVE_SEQUENCE)) { |
| 168 picture->nb_fields = (buffer[3] & 2) ? 3 : 2; | |
| 169 flags |= (buffer[3] & 128) ? PIC_FLAG_TOP_FIELD_FIRST : 0; | |
| 170 + flags |= (buffer[3] & 2) ? PIC_FLAG_REPEAT_FIRST_FIELD : 0; | |
| 171 } else | |
| 172 picture->nb_fields = (buffer[3]&2) ? ((buffer[3]&128) ? 6 : 4) : 2; | |
| 173 break; | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
174 @@ -799,6 +807,7 @@ |
| 12937 | 175 mpeg2dec->scaled[index] = mpeg2dec->q_scale_type; |
| 176 for (i = 0; i < 32; i++) { | |
| 177 k = mpeg2dec->q_scale_type ? non_linear_scale[i] : (i << 1); | |
| 13147 | 178 + decoder->quantizer_scales[i] = k; |
| 12937 | 179 for (j = 0; j < 64; j++) |
| 180 decoder->quantizer_prescale[index][i][j] = | |
| 181 k * mpeg2dec->quantizer_matrix[index][j]; | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
182 --- libmpeg2/idct.c 2006-06-16 20:12:26.000000000 +0200 |
|
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
183 +++ libmpeg2/idct.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
|
184 @@ -66,7 +70,7 @@ |
| 13864 | 185 } while (0) |
| 186 #endif | |
| 187 | |
| 188 -static void inline idct_row (int16_t * const block) | |
| 189 +static inline void idct_row (int16_t * const block) | |
| 190 { | |
| 191 int d0, d1, d2, d3; | |
| 192 int a0, a1, a2, a3, b0, b1, b2, b3; | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
193 @@ -119,7 +123,7 @@ |
| 13864 | 194 block[7] = (a0 - b0) >> 12; |
| 195 } | |
| 196 | |
| 197 -static void inline idct_col (int16_t * const block) | |
| 198 +static inline void idct_col (int16_t * const block) | |
| 199 { | |
| 200 int d0, d1, d2, d3; | |
| 201 int a0, a1, a2, a3, b0, b1, b2, b3; | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
202 @@ -235,7 +239,7 @@ |
| 13864 | 203 |
| 204 void mpeg2_idct_init (uint32_t accel) | |
| 205 { | |
| 206 -#ifdef ARCH_X86 | |
| 207 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
| 208 if (accel & MPEG2_ACCEL_X86_MMXEXT) { | |
| 209 mpeg2_idct_copy = mpeg2_idct_copy_mmxext; | |
| 210 mpeg2_idct_add = mpeg2_idct_add_mmxext; | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
211 @@ -254,11 +258,14 @@ |
| 13864 | 212 } else |
| 213 #endif | |
| 214 #ifdef ARCH_ALPHA | |
| 215 +#ifdef CAN_COMPILE_ALPHA_MVI | |
| 216 if (accel & MPEG2_ACCEL_ALPHA_MVI) { | |
| 217 mpeg2_idct_copy = mpeg2_idct_copy_mvi; | |
| 218 mpeg2_idct_add = mpeg2_idct_add_mvi; | |
| 219 mpeg2_idct_alpha_init (); | |
| 220 - } else if (accel & MPEG2_ACCEL_ALPHA) { | |
| 221 + } else | |
| 222 +#endif | |
| 223 + if (accel & MPEG2_ACCEL_ALPHA) { | |
| 224 int i; | |
| 225 | |
| 226 mpeg2_idct_copy = mpeg2_idct_copy_alpha; | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
227 --- libmpeg2/idct_alpha.c 2006-06-16 20:12:26.000000000 +0200 |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
228 +++ libmpeg2/idct_alpha.c 2006-06-16 20:12:50.000000000 +0200 |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
229 @@ -59,7 +63,7 @@ |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
230 } while (0) |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
231 #endif |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
232 |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
233 -static void inline idct_row (int16_t * const block) |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
234 +static inline void idct_row (int16_t * const block) |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
235 { |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
236 uint64_t l, r; |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
237 int_fast32_t d0, d1, d2, d3; |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
238 @@ -116,7 +120,7 @@ |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
239 block[7] = (a0 - b0) >> 12; |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
240 } |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
241 |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
242 -static void inline idct_col (int16_t * const block) |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
243 +static inline void idct_col (int16_t * const block) |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
244 { |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
245 int_fast32_t d0, d1, d2, d3; |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
246 int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3; |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
247 @@ -157,6 +161,7 @@ |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
248 block[8*7] = (a0 - b0) >> 17; |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
249 } |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
250 |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
251 +#ifdef CAN_COMPILE_ALPHA_MVI |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
252 void mpeg2_idct_copy_mvi (int16_t * block, uint8_t * dest, const int stride) |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
253 { |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
254 uint64_t clampmask; |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
255 @@ -289,6 +294,7 @@ |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
256 stq (p7, dest + 7 * stride); |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
257 } |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
258 } |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
259 +#endif |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
260 |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
261 void mpeg2_idct_copy_alpha (int16_t * block, uint8_t * dest, const int stride) |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
262 { |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
263 --- 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
|
264 +++ 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
|
265 @@ -23,7 +27,7 @@ |
| 13864 | 266 |
| 267 #include "config.h" | |
| 12937 | 268 |
| 13864 | 269 -#ifdef ARCH_X86 |
| 270 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
| 271 | |
| 272 #include <inttypes.h> | |
| 12937 | 273 |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
274 --- 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
|
275 +++ libmpeg2/motion_comp.c 2006-06-16 20:12:50.000000000 +0200 |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
276 @@ -33,7 +37,7 @@ |
| 13864 | 277 |
| 278 void mpeg2_mc_init (uint32_t accel) | |
| 12937 | 279 { |
| 13864 | 280 -#ifdef ARCH_X86 |
| 281 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
| 282 if (accel & MPEG2_ACCEL_X86_MMXEXT) | |
| 283 mpeg2_mc = mpeg2_mc_mmxext; | |
| 284 else if (accel & MPEG2_ACCEL_X86_3DNOW) | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
285 @@ -42,7 +46,7 @@ |
| 14730 | 286 mpeg2_mc = mpeg2_mc_mmx; |
| 12937 | 287 else |
| 288 #endif | |
| 14730 | 289 -#ifdef ARCH_PPC |
| 290 +#if defined(ARCH_PPC) && defined(HAVE_ALTIVEC) | |
| 12937 | 291 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) |
| 292 mpeg2_mc = mpeg2_mc_altivec; | |
| 293 else | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
294 @@ -52,7 +56,7 @@ |
| 12937 | 295 mpeg2_mc = mpeg2_mc_alpha; |
| 13020 | 296 else |
| 297 #endif | |
| 14730 | 298 -#ifdef ARCH_SPARC |
| 299 +#if defined(ARCH_SPARC) && defined(HAVE_VIS) | |
| 13020 | 300 if (accel & MPEG2_ACCEL_SPARC_VIS) |
| 301 mpeg2_mc = mpeg2_mc_vis; | |
| 302 else | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
303 --- 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
|
304 +++ 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
|
305 @@ -23,7 +27,7 @@ |
| 13864 | 306 |
| 307 #include "config.h" | |
| 308 | |
| 309 -#ifdef ARCH_X86 | |
| 310 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
| 311 | |
| 312 #include <inttypes.h> | |
| 313 | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
314 --- 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
|
315 +++ 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
|
316 @@ -19,6 +19,10 @@ |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
317 * You should have received a copy of the GNU General Public License |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
318 * along with this program; if not, write to the Free Software |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
319 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
320 + * |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
321 + * Modified for use with MPlayer, see libmpeg-0.4.0.diff for the exact changes. |
|
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
322 + * detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ |
|
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
323 + * $Id$ |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
324 */ |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
325 |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
326 #ifndef MPEG2_H |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
327 @@ -82,6 +86,7 @@ |
| 13147 | 328 #define PIC_FLAG_COMPOSITE_DISPLAY 32 |
| 329 #define PIC_FLAG_SKIP 64 | |
| 330 #define PIC_FLAG_TAGS 128 | |
| 331 +#define PIC_FLAG_REPEAT_FIRST_FIELD 256 | |
| 332 #define PIC_MASK_COMPOSITE_DISPLAY 0xfffff000 | |
| 333 | |
| 334 typedef struct mpeg2_picture_s { | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
335 @@ -154,6 +159,7 @@ |
|
18730
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
336 #define MPEG2_ACCEL_X86_MMX 1 |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
337 #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
|
338 #define MPEG2_ACCEL_X86_MMXEXT 4 |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
339 +#define MPEG2_ACCEL_X86_SSE2 8 |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
340 #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
|
341 #define MPEG2_ACCEL_ALPHA 1 |
|
93241711b635
sync with 18730 (Use MPlayer's CPU detection module instead of libmpeg2's)
gpoirier
parents:
14730
diff
changeset
|
342 #define MPEG2_ACCEL_ALPHA_MVI 2 |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
343 --- 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
|
344 +++ libmpeg2/mpeg2_internal.h 2006-06-16 20:12:50.000000000 +0200 |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
345 @@ -144,6 +148,12 @@ |
| 12937 | 346 int second_field; |
| 347 | |
| 348 int mpeg1; | |
| 349 + | |
| 350 + /* for MPlayer: */ | |
| 13147 | 351 + int quantizer_scales[32]; |
| 12937 | 352 + int quantizer_scale; |
| 353 + char* quant_store; | |
| 354 + int quant_stride; | |
| 355 }; | |
| 356 | |
| 357 typedef struct { | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
358 @@ -214,6 +224,10 @@ |
| 13147 | 359 int8_t q_scale_type, scaled[4]; |
| 360 uint8_t quantizer_matrix[4][64]; | |
| 361 uint8_t new_quantizer_matrix[4][64]; | |
| 362 + | |
| 363 + /* for MPlayer: */ | |
| 364 + unsigned char *pending_buffer; | |
| 365 + int pending_length; | |
| 366 }; | |
| 367 | |
| 368 typedef struct { | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
369 --- 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
|
370 +++ 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
|
371 @@ -142,6 +146,7 @@ |
| 13147 | 372 |
| 373 quantizer_scale_code = UBITS (bit_buf, 5); | |
| 374 DUMPBITS (bit_buf, bits, 5); | |
| 375 + decoder->quantizer_scale = decoder->quantizer_scales[quantizer_scale_code]; | |
| 376 | |
| 377 decoder->quantizer_matrix[0] = | |
| 378 decoder->quantizer_prescale[0][quantizer_scale_code]; | |
|
19024
4733c3e4f353
Update with latest changes and make diff apply cleanly.
diego
parents:
18783
diff
changeset
|
379 @@ -1564,6 +1569,9 @@ |
| 12937 | 380 |
| 381 #define NEXT_MACROBLOCK \ | |
| 382 do { \ | |
| 383 + if(decoder->quant_store) \ | |
| 384 + decoder->quant_store[decoder->quant_stride*(decoder->v_offset>>4) \ | |
| 385 + +(decoder->offset>>4)] = decoder->quantizer_scale; \ | |
| 386 decoder->offset += 16; \ | |
| 387 if (decoder->offset == decoder->width) { \ | |
| 388 do { /* just so we can use the break statement */ \ |
