# HG changeset patch # User michael # Date 1119998796 0 # Node ID 930e56f92c571646ea885e2ffd3792436f824c19 # Parent f3cdd51c9e161961d1d8d1d9a4809073d5cbcc3f IWMMXT configure support + runtime selection patch by (Gildas Bazin, gbazin : altern org) diff -r f3cdd51c9e16 -r 930e56f92c57 armv4l/dsputil_arm.c --- a/armv4l/dsputil_arm.c Tue Jun 28 14:56:16 2005 +0000 +++ b/armv4l/dsputil_arm.c Tue Jun 28 22:46:36 2005 +0000 @@ -240,9 +240,7 @@ c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_arm; //OK /* c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_arm;//NG */ -#if 1 #ifdef HAVE_IWMMXT dsputil_init_iwmmxt(c, avctx); #endif -#endif } diff -r f3cdd51c9e16 -r 930e56f92c57 armv4l/dsputil_iwmmxt.c --- a/armv4l/dsputil_iwmmxt.c Tue Jun 28 14:56:16 2005 +0000 +++ b/armv4l/dsputil_iwmmxt.c Tue Jun 28 22:46:36 2005 +0000 @@ -126,8 +126,26 @@ return; } +int mm_flags; /* multimedia extension flags */ + +int mm_support(void) +{ + return 0; /* TODO, implement proper detection */ +} + void dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx) { + mm_flags = mm_support(); + + if (avctx->dsp_mask) { + if (avctx->dsp_mask & FF_MM_FORCE) + mm_flags |= (avctx->dsp_mask & 0xffff); + else + mm_flags &= ~(avctx->dsp_mask & 0xffff); + } + + if (!(mm_flags & MM_IWMMXT)) return; + c->add_pixels_clamped = add_pixels_clamped_iwmmxt; c->put_pixels_tab[0][0] = put_pixels16_iwmmxt; diff -r f3cdd51c9e16 -r 930e56f92c57 armv4l/mpegvideo_iwmmxt.c --- a/armv4l/mpegvideo_iwmmxt.c Tue Jun 28 14:56:16 2005 +0000 +++ b/armv4l/mpegvideo_iwmmxt.c Tue Jun 28 22:46:36 2005 +0000 @@ -90,6 +90,8 @@ void MPV_common_init_iwmmxt(MpegEncContext *s) { + if (!(mm_flags & MM_IWMMXT)) return; + s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_iwmmxt; #if 0 s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_iwmmxt; diff -r f3cdd51c9e16 -r 930e56f92c57 avcodec.h --- a/avcodec.h Tue Jun 28 14:56:16 2005 +0000 +++ b/avcodec.h Tue Jun 28 22:46:36 2005 +0000 @@ -17,7 +17,7 @@ #define FFMPEG_VERSION_INT 0x000409 #define FFMPEG_VERSION "0.4.9-pre1" -#define LIBAVCODEC_BUILD 4756 +#define LIBAVCODEC_BUILD 4757 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT #define LIBAVCODEC_VERSION FFMPEG_VERSION @@ -1193,7 +1193,7 @@ #define FF_IDCT_SIMPLEARM 10 #define FF_IDCT_H264 11 #define FF_IDCT_VP3 12 -#define FP_IDCT_IPP 13 +#define FF_IDCT_IPP 13 /** * slice count. @@ -1236,6 +1236,9 @@ #define FF_MM_SSE2 0x0010 /* PIV SSE2 functions */ #define FF_MM_3DNOWEXT 0x0020 /* AMD 3DNowExt */ #endif /* HAVE_MMX */ +#ifdef HAVE_IWMMXT +#define FF_MM_IWMMXT 0x0100 /* XScale IWMMXT */ +#endif /* HAVE_IWMMXT */ /** * bits per sample/pixel from the demuxer (needed for huffyuv). diff -r f3cdd51c9e16 -r 930e56f92c57 dsputil.h --- a/dsputil.h Tue Jun 28 14:56:16 2005 +0000 +++ b/dsputil.h Tue Jun 28 22:46:36 2005 +0000 @@ -432,6 +432,10 @@ #define __align8 __attribute__ ((aligned (4))) #define STRIDE_ALIGN 4 +#define MM_IWMMXT 0x0100 /* XScale IWMMXT */ + +extern int mm_flags; + void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx); #elif defined(HAVE_MLIB)