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