Mercurial > mplayer.hg
annotate libmpeg2/libmpeg2_changes.diff @ 27596:33b8ad99fbcb
Fix segfault with rgb24 and full_internal_chroma due to non-existing alpha
byte being written after the array.
author | michael |
---|---|
date | Tue, 16 Sep 2008 03:49:54 +0000 |
parents | 1645692c116e |
children | 83d915449a10 |
rev | line source |
---|---|
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
1 --- libmpeg2/cpu_accel.c 2006-06-16 20:12:26.000000000 +0200 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
2 +++ libmpeg2/cpu_accel.c 2006-06-16 20:12:50.000000000 +0200 |
27573 | 3 @@ -29,9 +33,13 @@ |
4 #include "attributes.h" | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
5 #include "mpeg2_internal.h" |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
6 |
27573 | 7 +#include "cpudetect.h" |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
8 + |
27573 | 9 #if defined(ARCH_X86) || defined(ARCH_X86_64) |
10 static inline uint32_t arch_accel (uint32_t accel) | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
11 { |
27573 | 12 +/* Use MPlayer CPU detection instead of libmpeg2 variant. */ |
13 +#if 0 | |
14 if (accel & (MPEG2_ACCEL_X86_3DNOW | MPEG2_ACCEL_X86_MMXEXT)) | |
15 accel |= MPEG2_ACCEL_X86_MMX; | |
16 | |
17 @@ -124,6 +132,21 @@ | |
18 #endif /* ACCEL_DETECT */ | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
19 |
27573 | 20 return accel; |
21 + | |
22 +#else /* 0 */ | |
23 + accel = 0; | |
24 + if (gCpuCaps.hasMMX) | |
25 + accel |= MPEG2_ACCEL_X86_MMX; | |
26 + if (gCpuCaps.hasSSE2) | |
27 + accel |= MPEG2_ACCEL_X86_SSE2; | |
28 + if (gCpuCaps.hasMMX2) | |
29 + accel |= MPEG2_ACCEL_X86_MMXEXT; | |
30 + if (gCpuCaps.has3DNow) | |
31 + accel |= MPEG2_ACCEL_X86_3DNOW; | |
32 + | |
33 + return accel; | |
34 + | |
35 +#endif /* 0 */ | |
36 } | |
37 #endif /* ARCH_X86 || ARCH_X86_64 */ | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
38 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
39 --- libmpeg2/decode.c 2006-06-16 20:12:26.000000000 +0200 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
40 +++ libmpeg2/decode.c 2006-06-16 20:12:50.000000000 +0200 |
27573 | 41 @@ -345,6 +349,15 @@ |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
42 fbuf->buf[1] = buf[1]; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
43 fbuf->buf[2] = buf[2]; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
44 fbuf->id = id; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
45 + // HACK! FIXME! At first I frame, copy pointers to prediction frame too! |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
46 + if (mpeg2dec->custom_fbuf && !mpeg2dec->fbuf[1]->buf[0]){ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
47 + mpeg2dec->fbuf[1]->buf[0]=buf[0]; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
48 + mpeg2dec->fbuf[1]->buf[1]=buf[1]; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
49 + mpeg2dec->fbuf[1]->buf[2]=buf[2]; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
50 + mpeg2dec->fbuf[1]->id=NULL; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
51 + } |
27573 | 52 +// printf("libmpeg2: FBUF 0:%p 1:%p 2:%p\n", |
53 +// mpeg2dec->fbuf[0]->buf[0],mpeg2dec->fbuf[1]->buf[0],mpeg2dec->fbuf[2]->buf[0]); | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
54 } |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
55 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
56 void mpeg2_custom_fbuf (mpeg2dec_t * mpeg2dec, int custom_fbuf) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
57 --- libmpeg2/header.c 2006-06-16 20:12:26.000000000 +0200 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
58 +++ libmpeg2/header.c 2006-06-16 20:12:50.000000000 +0200 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
59 @@ -100,6 +104,9 @@ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
60 mpeg2dec->decoder.convert = NULL; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
61 mpeg2dec->decoder.convert_id = NULL; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
62 mpeg2dec->picture = mpeg2dec->pictures; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
63 + memset(&mpeg2dec->fbuf_alloc[0].fbuf, 0, sizeof(mpeg2_fbuf_t)); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
64 + memset(&mpeg2dec->fbuf_alloc[1].fbuf, 0, sizeof(mpeg2_fbuf_t)); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
65 + memset(&mpeg2dec->fbuf_alloc[2].fbuf, 0, sizeof(mpeg2_fbuf_t)); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
66 mpeg2dec->fbuf[0] = &mpeg2dec->fbuf_alloc[0].fbuf; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
67 mpeg2dec->fbuf[1] = &mpeg2dec->fbuf_alloc[1].fbuf; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
68 mpeg2dec->fbuf[2] = &mpeg2dec->fbuf_alloc[2].fbuf; |
27573 | 69 @@ -872,6 +879,7 @@ |
70 mpeg2dec->scaled[idx] = decoder->q_scale_type; | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
71 for (i = 0; i < 32; i++) { |
27573 | 72 k = decoder->q_scale_type ? non_linear_scale[i] : (i << 1); |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
73 + decoder->quantizer_scales[i] = k; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
74 for (j = 0; j < 64; j++) |
27573 | 75 decoder->quantizer_prescale[idx][i][j] = |
76 k * mpeg2dec->quantizer_matrix[idx][j]; | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
77 --- libmpeg2/idct.c (revision 26652) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
78 +++ libmpeg2/idct.c (working copy) |
27573 | 79 @@ -235,34 +239,40 @@ |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
80 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
81 void mpeg2_idct_init (uint32_t accel) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
82 { |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
83 -#ifdef ARCH_X86 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
84 +#ifdef HAVE_SSE2 |
27573 | 85 if (accel & MPEG2_ACCEL_X86_SSE2) { |
86 mpeg2_idct_copy = mpeg2_idct_copy_sse2; | |
87 mpeg2_idct_add = mpeg2_idct_add_sse2; | |
88 mpeg2_idct_mmx_init (); | |
89 - } else if (accel & MPEG2_ACCEL_X86_MMXEXT) { | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
90 + } else |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
91 +#elif HAVE_MMX2 |
27573 | 92 + if (accel & MPEG2_ACCEL_X86_MMXEXT) { |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
93 mpeg2_idct_copy = mpeg2_idct_copy_mmxext; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
94 mpeg2_idct_add = mpeg2_idct_add_mmxext; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
95 mpeg2_idct_mmx_init (); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
96 - } else if (accel & MPEG2_ACCEL_X86_MMX) { |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
97 + } else |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
98 +#elif HAVE_MMX |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
99 + if (accel & MPEG2_ACCEL_X86_MMX) { |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
100 mpeg2_idct_copy = mpeg2_idct_copy_mmx; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
101 mpeg2_idct_add = mpeg2_idct_add_mmx; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
102 mpeg2_idct_mmx_init (); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
103 } else |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
104 #endif |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
105 -#ifdef ARCH_PPC |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
106 +#ifdef HAVE_ALTIVEC |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
107 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) { |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
108 mpeg2_idct_copy = mpeg2_idct_copy_altivec; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
109 mpeg2_idct_add = mpeg2_idct_add_altivec; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
110 mpeg2_idct_altivec_init (); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
111 } else |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
112 #endif |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
113 -#ifdef ARCH_ALPHA |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
114 +#ifdef HAVE_VIS |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
115 if (accel & MPEG2_ACCEL_ALPHA_MVI) { |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
116 mpeg2_idct_copy = mpeg2_idct_copy_mvi; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
117 mpeg2_idct_add = mpeg2_idct_add_mvi; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
118 mpeg2_idct_alpha_init (); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
119 - } else if (accel & MPEG2_ACCEL_ALPHA) { |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
120 + } else |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
121 +#elif ARCH_ALPHA |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
122 + if (accel & MPEG2_ACCEL_ALPHA) { |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
123 int i; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
124 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
125 mpeg2_idct_copy = mpeg2_idct_copy_alpha; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
126 --- libmpeg2/motion_comp.c 2006-06-16 20:12:26.000000000 +0200 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
127 +++ libmpeg2/motion_comp.c 2006-06-16 20:12:50.000000000 +0200 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
128 @@ -33,16 +37,22 @@ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
129 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
130 void mpeg2_mc_init (uint32_t accel) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
131 { |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
132 -#ifdef ARCH_X86 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
133 +#ifdef HAVE_MMX2 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
134 if (accel & MPEG2_ACCEL_X86_MMXEXT) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
135 mpeg2_mc = mpeg2_mc_mmxext; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
136 - else if (accel & MPEG2_ACCEL_X86_3DNOW) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
137 + else |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
138 +#endif |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
139 +#ifdef HAVE_3DNOW |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
140 + if (accel & MPEG2_ACCEL_X86_3DNOW) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
141 mpeg2_mc = mpeg2_mc_3dnow; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
142 - else if (accel & MPEG2_ACCEL_X86_MMX) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
143 + else |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
144 +#endif |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
145 +#ifdef HAVE_MMX |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
146 + if (accel & MPEG2_ACCEL_X86_MMX) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
147 mpeg2_mc = mpeg2_mc_mmx; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
148 else |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
149 #endif |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
150 -#ifdef ARCH_PPC |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
151 +#ifdef HAVE_ALTIVEC |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
152 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
153 mpeg2_mc = mpeg2_mc_altivec; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
154 else |
27573 | 155 @@ -52,15 +62,20 @@ |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
156 mpeg2_mc = mpeg2_mc_alpha; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
157 else |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
158 #endif |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
159 -#ifdef ARCH_SPARC |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
160 +#ifdef HAVE_VIS |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
161 if (accel & MPEG2_ACCEL_SPARC_VIS) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
162 mpeg2_mc = mpeg2_mc_vis; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
163 else |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
164 #endif |
27573 | 165 #ifdef ARCH_ARM |
166 - if (accel & MPEG2_ACCEL_ARM) { | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
167 +#ifdef HAVE_IWMMXT |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
168 + if (accel & MPEG2_ACCEL_ARM_IWMMXT) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
169 + mpeg2_mc = mpeg2_mc_iwmmxt; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
170 + else |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
171 +#endif |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
172 + if (accel & MPEG2_ACCEL_ARM) |
27573 | 173 mpeg2_mc = mpeg2_mc_arm; |
174 - } else | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
175 + else |
27573 | 176 #endif |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
177 mpeg2_mc = mpeg2_mc_c; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
178 } |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
179 --- include/mpeg2.h 2006-06-16 20:12:26.000000000 +0200 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
180 +++ libmpeg2/mpeg2.h 2006-06-16 20:12:50.000000000 +0200 |
27573 | 181 @@ -164,6 +168,7 @@ |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
182 #define MPEG2_ACCEL_SPARC_VIS 1 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
183 #define MPEG2_ACCEL_SPARC_VIS2 2 |
27573 | 184 #define MPEG2_ACCEL_ARM 1 |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
185 +#define MPEG2_ACCEL_ARM_IWMMXT 2 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
186 #define MPEG2_ACCEL_DETECT 0x80000000 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
187 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
188 uint32_t mpeg2_accel (uint32_t accel); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
189 --- libmpeg2/mpeg2_internal.h 2006-06-16 20:12:26.000000000 +0200 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
190 +++ libmpeg2/mpeg2_internal.h 2006-06-16 20:12:50.000000000 +0200 |
27573 | 191 @@ -152,6 +156,11 @@ |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
192 |
27573 | 193 /* XXX: stuff due to xine shit */ |
194 int8_t q_scale_type; | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
195 + |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
196 + int quantizer_scales[32]; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
197 + int quantizer_scale; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
198 + char* quant_store; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
199 + int quant_stride; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
200 }; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
201 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
202 typedef struct { |
27573 | 203 @@ -223,6 +232,9 @@ |
204 //int8_t q_scale_type, scaled[4]; | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
205 uint8_t quantizer_matrix[4][64]; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
206 uint8_t new_quantizer_matrix[4][64]; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
207 + |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
208 + unsigned char *pending_buffer; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
209 + int pending_length; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
210 }; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
211 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
212 typedef struct { |
27573 | 213 @@ -313,5 +325,6 @@ |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
214 extern mpeg2_mc_t mpeg2_mc_alpha; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
215 extern mpeg2_mc_t mpeg2_mc_vis; |
27573 | 216 extern mpeg2_mc_t mpeg2_mc_arm; |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
217 +extern mpeg2_mc_t mpeg2_mc_iwmmxt; |
27573 | 218 |
219 #endif /* LIBMPEG2_MPEG2_INTERNAL_H */ | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
220 --- libmpeg2/slice.c 2006-06-16 20:12:26.000000000 +0200 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
221 +++ libmpeg2/slice.c 2006-06-16 20:12:50.000000000 +0200 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
222 @@ -142,6 +146,7 @@ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
223 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
224 quantizer_scale_code = UBITS (bit_buf, 5); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
225 DUMPBITS (bit_buf, bits, 5); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
226 + decoder->quantizer_scale = decoder->quantizer_scales[quantizer_scale_code]; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
227 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
228 decoder->quantizer_matrix[0] = |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
229 decoder->quantizer_prescale[0][quantizer_scale_code]; |
27573 | 230 @@ -1564,6 +1569,24 @@ |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
231 |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
232 #define NEXT_MACROBLOCK \ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
233 do { \ |
27573 | 234 + if(decoder->quant_store) { \ |
235 + if (decoder->picture_structure == TOP_FIELD) \ | |
236 + decoder->quant_store[2 * decoder->quant_stride \ | |
237 + * (decoder->v_offset >> 4) \ | |
238 + + (decoder->offset >> 4)] \ | |
239 + = decoder->quantizer_scale; \ | |
240 + else if (decoder->picture_structure == BOTTOM_FIELD) \ | |
241 + decoder->quant_store[2 * decoder->quant_stride \ | |
242 + * (decoder->v_offset >> 4) \ | |
243 + + decoder->quant_stride \ | |
244 + + (decoder->offset >> 4)] \ | |
245 + = decoder->quantizer_scale; \ | |
246 + else \ | |
247 + decoder->quant_store[decoder->quant_stride \ | |
248 + * (decoder->v_offset >> 4) \ | |
249 + + (decoder->offset >> 4)] \ | |
250 + = decoder->quantizer_scale; \ | |
251 + } \ | |
27569
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
252 decoder->offset += 16; \ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
253 if (decoder->offset == decoder->width) { \ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
254 do { /* just so we can use the break statement */ \ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
255 Index: libmpeg2/motion_comp_iwmmxt.c |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
256 =================================================================== |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
257 --- libmpeg2/motion_comp_iwmmxt.c (revision 0) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
258 +++ libmpeg2/motion_comp_iwmmxt.c (revision 0) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
259 @@ -0,0 +1,59 @@ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
260 +/* |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
261 + * motion_comp_iwmmxt.c |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
262 + * Copyright (C) 2004 AGAWA Koji <i (AT) atty (DOT) jp> |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
263 + * |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
264 + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
265 + * See http://libmpeg2.sourceforge.net/ for updates. |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
266 + * |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
267 + * mpeg2dec is free software; you can redistribute it and/or modify |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
268 + * it under the terms of the GNU General Public License as published by |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
269 + * the Free Software Foundation; either version 2 of the License, or |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
270 + * (at your option) any later version. |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
271 + * |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
272 + * mpeg2dec is distributed in the hope that it will be useful, |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
273 + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
274 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
275 + * GNU General Public License for more details. |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
276 + * |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
277 + * You should have received a copy of the GNU General Public License |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
278 + * along with this program; if not, write to the Free Software |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
279 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
280 + */ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
281 + |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
282 +#include "config.h" |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
283 + |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
284 +#if defined(ARCH_ARM) && defined(HAVE_IWMMXT) |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
285 + |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
286 +#include <inttypes.h> |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
287 + |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
288 +#include "mpeg2.h" |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
289 +#include "attributes.h" |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
290 +#include "mpeg2_internal.h" |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
291 + |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
292 +/* defined in libavcodec */ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
293 + |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
294 +extern void put_pixels16_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
295 +extern void put_pixels16_x2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
296 +extern void put_pixels16_y2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
297 +extern void put_pixels16_xy2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
298 +extern void put_pixels8_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
299 +extern void put_pixels8_x2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
300 +extern void put_pixels8_y2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
301 +extern void put_pixels8_xy2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
302 +extern void avg_pixels16_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
303 +extern void avg_pixels16_x2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
304 +extern void avg_pixels16_y2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
305 +extern void avg_pixels16_xy2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
306 +extern void avg_pixels8_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
307 +extern void avg_pixels8_x2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
308 +extern void avg_pixels8_y2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
309 +extern void avg_pixels8_xy2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height); |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
310 + |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
311 +mpeg2_mc_t mpeg2_mc_iwmmxt = { |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
312 + {put_pixels16_iwmmxt, put_pixels16_x2_iwmmxt, put_pixels16_y2_iwmmxt, put_pixels16_xy2_iwmmxt, |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
313 + put_pixels8_iwmmxt, put_pixels8_x2_iwmmxt, put_pixels8_y2_iwmmxt, put_pixels8_xy2_iwmmxt}, \ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
314 + {avg_pixels16_iwmmxt, avg_pixels16_x2_iwmmxt, avg_pixels16_y2_iwmmxt, avg_pixels16_xy2_iwmmxt, |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
315 + avg_pixels8_iwmmxt, avg_pixels8_x2_iwmmxt, avg_pixels8_y2_iwmmxt, avg_pixels8_xy2_iwmmxt}, \ |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
316 +}; |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
317 + |
7c3d535aba22
Remove version string from name of local changes diff file.
diego
parents:
diff
changeset
|
318 +#endif /* defined(ARCH_ARM) && defined(HAVE_IWMMXT) */ |