comparison libmpeg2/libmpeg2_changes.diff @ 27645:83d915449a10

Remove IWMMXT optimizations through libavcodec from libmpeg2. According to Siarhei Siamashka libavcodec is faster on ARM so it is better to use it directly instead of creating this hackish mix of two libraries. Plus, these local changes would never be acceptable upstream, so no good reason for keeping it in our local patchset remains.
author diego
date Wed, 01 Oct 2008 01:01:59 +0000
parents 1645692c116e
children 5c4dbd36c0cf
comparison
equal deleted inserted replaced
27644:92787d5c8f97 27645:83d915449a10
150 -#ifdef ARCH_PPC 150 -#ifdef ARCH_PPC
151 +#ifdef HAVE_ALTIVEC 151 +#ifdef HAVE_ALTIVEC
152 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) 152 if (accel & MPEG2_ACCEL_PPC_ALTIVEC)
153 mpeg2_mc = mpeg2_mc_altivec; 153 mpeg2_mc = mpeg2_mc_altivec;
154 else 154 else
155 @@ -52,15 +62,20 @@ 155 @@ -52,15 +62,15 @@
156 mpeg2_mc = mpeg2_mc_alpha; 156 mpeg2_mc = mpeg2_mc_alpha;
157 else 157 else
158 #endif 158 #endif
159 -#ifdef ARCH_SPARC 159 -#ifdef ARCH_SPARC
160 +#ifdef HAVE_VIS 160 +#ifdef HAVE_VIS
162 mpeg2_mc = mpeg2_mc_vis; 162 mpeg2_mc = mpeg2_mc_vis;
163 else 163 else
164 #endif 164 #endif
165 #ifdef ARCH_ARM 165 #ifdef ARCH_ARM
166 - if (accel & MPEG2_ACCEL_ARM) { 166 - if (accel & MPEG2_ACCEL_ARM) {
167 +#ifdef HAVE_IWMMXT
168 + if (accel & MPEG2_ACCEL_ARM_IWMMXT)
169 + mpeg2_mc = mpeg2_mc_iwmmxt;
170 + else
171 +#endif
172 + if (accel & MPEG2_ACCEL_ARM) 167 + if (accel & MPEG2_ACCEL_ARM)
173 mpeg2_mc = mpeg2_mc_arm; 168 mpeg2_mc = mpeg2_mc_arm;
174 - } else 169 - } else
175 + else 170 + else
176 #endif 171 #endif
177 mpeg2_mc = mpeg2_mc_c; 172 mpeg2_mc = mpeg2_mc_c;
178 } 173 }
179 --- include/mpeg2.h 2006-06-16 20:12:26.000000000 +0200
180 +++ libmpeg2/mpeg2.h 2006-06-16 20:12:50.000000000 +0200
181 @@ -164,6 +168,7 @@
182 #define MPEG2_ACCEL_SPARC_VIS 1
183 #define MPEG2_ACCEL_SPARC_VIS2 2
184 #define MPEG2_ACCEL_ARM 1
185 +#define MPEG2_ACCEL_ARM_IWMMXT 2
186 #define MPEG2_ACCEL_DETECT 0x80000000
187
188 uint32_t mpeg2_accel (uint32_t accel);
189 --- libmpeg2/mpeg2_internal.h 2006-06-16 20:12:26.000000000 +0200 174 --- libmpeg2/mpeg2_internal.h 2006-06-16 20:12:26.000000000 +0200
190 +++ libmpeg2/mpeg2_internal.h 2006-06-16 20:12:50.000000000 +0200 175 +++ libmpeg2/mpeg2_internal.h 2006-06-16 20:12:50.000000000 +0200
191 @@ -152,6 +156,11 @@ 176 @@ -152,6 +156,11 @@
192 177
193 /* XXX: stuff due to xine shit */ 178 /* XXX: stuff due to xine shit */
208 + unsigned char *pending_buffer; 193 + unsigned char *pending_buffer;
209 + int pending_length; 194 + int pending_length;
210 }; 195 };
211 196
212 typedef struct { 197 typedef struct {
213 @@ -313,5 +325,6 @@
214 extern mpeg2_mc_t mpeg2_mc_alpha;
215 extern mpeg2_mc_t mpeg2_mc_vis;
216 extern mpeg2_mc_t mpeg2_mc_arm;
217 +extern mpeg2_mc_t mpeg2_mc_iwmmxt;
218
219 #endif /* LIBMPEG2_MPEG2_INTERNAL_H */
220 --- libmpeg2/slice.c 2006-06-16 20:12:26.000000000 +0200 198 --- libmpeg2/slice.c 2006-06-16 20:12:26.000000000 +0200
221 +++ libmpeg2/slice.c 2006-06-16 20:12:50.000000000 +0200 199 +++ libmpeg2/slice.c 2006-06-16 20:12:50.000000000 +0200
222 @@ -142,6 +146,7 @@ 200 @@ -142,6 +146,7 @@
223 201
224 quantizer_scale_code = UBITS (bit_buf, 5); 202 quantizer_scale_code = UBITS (bit_buf, 5);
250 + = decoder->quantizer_scale; \ 228 + = decoder->quantizer_scale; \
251 + } \ 229 + } \
252 decoder->offset += 16; \ 230 decoder->offset += 16; \
253 if (decoder->offset == decoder->width) { \ 231 if (decoder->offset == decoder->width) { \
254 do { /* just so we can use the break statement */ \ 232 do { /* just so we can use the break statement */ \
255 Index: libmpeg2/motion_comp_iwmmxt.c
256 ===================================================================
257 --- libmpeg2/motion_comp_iwmmxt.c (revision 0)
258 +++ libmpeg2/motion_comp_iwmmxt.c (revision 0)
259 @@ -0,0 +1,59 @@
260 +/*
261 + * motion_comp_iwmmxt.c
262 + * Copyright (C) 2004 AGAWA Koji <i (AT) atty (DOT) jp>
263 + *
264 + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
265 + * See http://libmpeg2.sourceforge.net/ for updates.
266 + *
267 + * mpeg2dec is free software; you can redistribute it and/or modify
268 + * it under the terms of the GNU General Public License as published by
269 + * the Free Software Foundation; either version 2 of the License, or
270 + * (at your option) any later version.
271 + *
272 + * mpeg2dec is distributed in the hope that it will be useful,
273 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
274 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
275 + * GNU General Public License for more details.
276 + *
277 + * You should have received a copy of the GNU General Public License
278 + * along with this program; if not, write to the Free Software
279 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
280 + */
281 +
282 +#include "config.h"
283 +
284 +#if defined(ARCH_ARM) && defined(HAVE_IWMMXT)
285 +
286 +#include <inttypes.h>
287 +
288 +#include "mpeg2.h"
289 +#include "attributes.h"
290 +#include "mpeg2_internal.h"
291 +
292 +/* defined in libavcodec */
293 +
294 +extern void put_pixels16_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
295 +extern void put_pixels16_x2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
296 +extern void put_pixels16_y2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
297 +extern void put_pixels16_xy2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
298 +extern void put_pixels8_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
299 +extern void put_pixels8_x2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
300 +extern void put_pixels8_y2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
301 +extern void put_pixels8_xy2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
302 +extern void avg_pixels16_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
303 +extern void avg_pixels16_x2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
304 +extern void avg_pixels16_y2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
305 +extern void avg_pixels16_xy2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
306 +extern void avg_pixels8_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
307 +extern void avg_pixels8_x2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
308 +extern void avg_pixels8_y2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
309 +extern void avg_pixels8_xy2_iwmmxt(uint8_t * dest, const uint8_t * ref, const int stride, int height);
310 +
311 +mpeg2_mc_t mpeg2_mc_iwmmxt = {
312 + {put_pixels16_iwmmxt, put_pixels16_x2_iwmmxt, put_pixels16_y2_iwmmxt, put_pixels16_xy2_iwmmxt,
313 + put_pixels8_iwmmxt, put_pixels8_x2_iwmmxt, put_pixels8_y2_iwmmxt, put_pixels8_xy2_iwmmxt}, \
314 + {avg_pixels16_iwmmxt, avg_pixels16_x2_iwmmxt, avg_pixels16_y2_iwmmxt, avg_pixels16_xy2_iwmmxt,
315 + avg_pixels8_iwmmxt, avg_pixels8_x2_iwmmxt, avg_pixels8_y2_iwmmxt, avg_pixels8_xy2_iwmmxt}, \
316 +};
317 +
318 +#endif /* defined(ARCH_ARM) && defined(HAVE_IWMMXT) */