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