[FFmpeg-cvslog] r24909 - in trunk/libavcodec: arm/dsputil_iwmmxt.c dsputil.h h263dec.c ppc/dsputil_ppc.c ppc/mpegvideo_altivec.c x86/dnxhd_mmx.c x86/dsputil_mmx.c x86/dsputilenc_mmx.c x86/h264dsp_mmx.c x86/motion_...

mru subversion
Tue Aug 24 19:47:06 CEST 2010


Author: mru
Date: Tue Aug 24 19:47:05 2010
New Revision: 24909

Log:
Remove global mm_flags variable

Modified:
   trunk/libavcodec/arm/dsputil_iwmmxt.c
   trunk/libavcodec/dsputil.h
   trunk/libavcodec/h263dec.c
   trunk/libavcodec/ppc/dsputil_ppc.c
   trunk/libavcodec/ppc/mpegvideo_altivec.c
   trunk/libavcodec/x86/dnxhd_mmx.c
   trunk/libavcodec/x86/dsputil_mmx.c
   trunk/libavcodec/x86/dsputilenc_mmx.c
   trunk/libavcodec/x86/h264dsp_mmx.c
   trunk/libavcodec/x86/motion_est_mmx.c
   trunk/libavcodec/x86/mpegaudiodec_mmx.c
   trunk/libavcodec/x86/mpegvideo_mmx.c
   trunk/libavcodec/x86/snowdsp_mmx.c
   trunk/libavcodec/x86/vc1dsp_mmx.c
   trunk/libavcodec/x86/vp8dsp-init.c

Modified: trunk/libavcodec/arm/dsputil_iwmmxt.c
==============================================================================
--- trunk/libavcodec/arm/dsputil_iwmmxt.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/arm/dsputil_iwmmxt.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -150,10 +150,11 @@ static void nop(uint8_t *block, const ui
 /* A run time test is not simple. If this file is compiled in
  * then we should install the functions
  */
-int mm_flags = FF_MM_IWMMXT; /* multimedia extension flags */
 
 void ff_dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx)
 {
+    int mm_flags = FF_MM_IWMMXT; /* multimedia extension flags */
+
     if (avctx->dsp_mask) {
         if (avctx->dsp_mask & FF_MM_FORCE)
             mm_flags |= (avctx->dsp_mask & 0xffff);

Modified: trunk/libavcodec/dsputil.h
==============================================================================
--- trunk/libavcodec/dsputil.h	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/dsputil.h	Tue Aug 24 19:47:05 2010	(r24909)
@@ -618,7 +618,6 @@ static inline int get_penalty_factor(int
 /* should be defined by architectures supporting
    one or more MultiMedia extension */
 int mm_support(void);
-extern int mm_flags;
 
 void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
 void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx);
@@ -647,12 +646,7 @@ static inline void emms(void)
     __asm__ volatile ("emms;":::"memory");
 }
 
-
-#define emms_c() \
-{\
-    if (mm_flags & FF_MM_MMX)\
-        emms();\
-}
+#define emms_c() emms()
 
 #elif ARCH_ARM
 
@@ -670,7 +664,6 @@ static inline void emms(void)
 
 #else
 
-#define mm_flags 0
 #define mm_support() 0
 
 #endif

Modified: trunk/libavcodec/h263dec.c
==============================================================================
--- trunk/libavcodec/h263dec.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/h263dec.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -553,7 +553,7 @@ retry:
 #endif
 
 #if HAVE_MMX
-    if(s->codec_id == CODEC_ID_MPEG4 && s->xvid_build>=0 && avctx->idct_algo == FF_IDCT_AUTO && (mm_flags & FF_MM_MMX)){
+    if(s->codec_id == CODEC_ID_MPEG4 && s->xvid_build>=0 && avctx->idct_algo == FF_IDCT_AUTO && (mm_support() & FF_MM_MMX)){
         avctx->idct_algo= FF_IDCT_XVIDMMX;
         avctx->coded_width= 0; // force reinit
 //        dsputil_init(&s->dsp, avctx);

Modified: trunk/libavcodec/ppc/dsputil_ppc.c
==============================================================================
--- trunk/libavcodec/ppc/dsputil_ppc.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/ppc/dsputil_ppc.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -23,8 +23,6 @@
 #include "libavcodec/dsputil.h"
 #include "dsputil_altivec.h"
 
-int mm_flags = 0;
-
 int mm_support(void)
 {
     int result = 0;
@@ -182,8 +180,6 @@ void dsputil_init_ppc(DSPContext* c, AVC
     if(CONFIG_H264_DECODER) dsputil_h264_init_ppc(c, avctx);
 
     if (has_altivec()) {
-        mm_flags |= FF_MM_ALTIVEC;
-
         dsputil_init_altivec(c, avctx);
         if(CONFIG_VC1_DECODER)
             vc1dsp_init_altivec(c, avctx);

Modified: trunk/libavcodec/ppc/mpegvideo_altivec.c
==============================================================================
--- trunk/libavcodec/ppc/mpegvideo_altivec.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/ppc/mpegvideo_altivec.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -570,7 +570,7 @@ static void dct_unquantize_h263_altivec(
 
 void MPV_common_init_altivec(MpegEncContext *s)
 {
-    if ((mm_flags & FF_MM_ALTIVEC) == 0) return;
+    if (!has_altivec()) return;
 
     if (s->avctx->lowres==0) {
         if ((s->avctx->idct_algo == FF_IDCT_AUTO) ||

Modified: trunk/libavcodec/x86/dnxhd_mmx.c
==============================================================================
--- trunk/libavcodec/x86/dnxhd_mmx.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/x86/dnxhd_mmx.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -52,7 +52,7 @@ static void get_pixels_8x4_sym_sse2(DCTE
 
 void ff_dnxhd_init_mmx(DNXHDEncContext *ctx)
 {
-    if (mm_flags & FF_MM_SSE2) {
+    if (mm_support() & FF_MM_SSE2) {
         ctx->get_pixels_8x4_sym = get_pixels_8x4_sym_sse2;
     }
 }

Modified: trunk/libavcodec/x86/dsputil_mmx.c
==============================================================================
--- trunk/libavcodec/x86/dsputil_mmx.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/x86/dsputil_mmx.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -37,8 +37,6 @@
 //#undef NDEBUG
 //#include <assert.h>
 
-int mm_flags; /* multimedia extension flags */
-
 /* pixel operations */
 DECLARE_ALIGNED(8,  const uint64_t, ff_bone) = 0x0101010101010101ULL;
 DECLARE_ALIGNED(8,  const uint64_t, ff_wtwo) = 0x0002000200020002ULL;
@@ -2504,7 +2502,7 @@ float ff_scalarproduct_float_sse(const f
 
 void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
 {
-    mm_flags = mm_support();
+    int mm_flags = mm_support();
 
     if (avctx->dsp_mask) {
         if (avctx->dsp_mask & FF_MM_FORCE)
@@ -2941,7 +2939,7 @@ void dsputil_init_mmx(DSPContext* c, AVC
 #if CONFIG_H264DSP
 void ff_h264dsp_init_x86(H264DSPContext *c)
 {
-    mm_flags = mm_support();
+    int mm_flags = mm_support();
 
     if (mm_flags & FF_MM_MMX) {
         c->h264_idct_dc_add=

Modified: trunk/libavcodec/x86/dsputilenc_mmx.c
==============================================================================
--- trunk/libavcodec/x86/dsputilenc_mmx.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/x86/dsputilenc_mmx.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -1350,6 +1350,8 @@ static int ssd_int8_vs_int16_mmx(const i
 
 void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx)
 {
+    int mm_flags = mm_support();
+
     if (mm_flags & FF_MM_MMX) {
         const int dct_algo = avctx->dct_algo;
         if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){

Modified: trunk/libavcodec/x86/h264dsp_mmx.c
==============================================================================
--- trunk/libavcodec/x86/h264dsp_mmx.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/x86/h264dsp_mmx.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -2368,7 +2368,7 @@ void ff_pred4x4_vertical_vp8_mmxext(uint
 #if CONFIG_H264PRED
 void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
 {
-    mm_flags = mm_support();
+    int mm_flags = mm_support();
 
 #if HAVE_YASM
     if (mm_flags & FF_MM_MMX) {

Modified: trunk/libavcodec/x86/motion_est_mmx.c
==============================================================================
--- trunk/libavcodec/x86/motion_est_mmx.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/x86/motion_est_mmx.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -427,6 +427,8 @@ PIX_SAD(mmx2)
 
 void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx)
 {
+    int mm_flags = mm_support();
+
     if (mm_flags & FF_MM_MMX) {
         c->pix_abs[0][0] = sad16_mmx;
         c->pix_abs[0][1] = sad16_x2_mmx;

Modified: trunk/libavcodec/x86/mpegaudiodec_mmx.c
==============================================================================
--- trunk/libavcodec/x86/mpegaudiodec_mmx.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/x86/mpegaudiodec_mmx.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -149,7 +149,7 @@ static void apply_window_mp3(float *in, 
 
 void ff_mpegaudiodec_init_mmx(MPADecodeContext *s)
 {
-    mm_flags = mm_support();
+    int mm_flags = mm_support();
 
     if (mm_flags & FF_MM_SSE2) {
         s->apply_window_mp3 = apply_window_mp3;

Modified: trunk/libavcodec/x86/mpegvideo_mmx.c
==============================================================================
--- trunk/libavcodec/x86/mpegvideo_mmx.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/x86/mpegvideo_mmx.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -625,6 +625,8 @@ static void  denoise_dct_sse2(MpegEncCon
 
 void MPV_common_init_mmx(MpegEncContext *s)
 {
+    int mm_flags = mm_support();
+
     if (mm_flags & FF_MM_MMX) {
         const int dct_algo = s->avctx->dct_algo;
 

Modified: trunk/libavcodec/x86/snowdsp_mmx.c
==============================================================================
--- trunk/libavcodec/x86/snowdsp_mmx.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/x86/snowdsp_mmx.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -874,7 +874,7 @@ static void ff_snow_inner_add_yblock_mmx
 
 void ff_dwt_init_x86(DWTContext *c)
 {
-    mm_flags = mm_support();
+    int mm_flags = mm_support();
 
     if (mm_flags & FF_MM_MMX) {
         if(mm_flags & FF_MM_SSE2 & 0){

Modified: trunk/libavcodec/x86/vc1dsp_mmx.c
==============================================================================
--- trunk/libavcodec/x86/vc1dsp_mmx.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/x86/vc1dsp_mmx.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -714,7 +714,7 @@ static void vc1_h_loop_filter16_sse4(uin
 #endif
 
 void ff_vc1dsp_init_mmx(DSPContext* dsp, AVCodecContext *avctx) {
-    mm_flags = mm_support();
+    int mm_flags = mm_support();
 
     dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_vc1_mspel_mc00_mmx;
     dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_mmx;

Modified: trunk/libavcodec/x86/vp8dsp-init.c
==============================================================================
--- trunk/libavcodec/x86/vp8dsp-init.c	Tue Aug 24 18:52:27 2010	(r24908)
+++ trunk/libavcodec/x86/vp8dsp-init.c	Tue Aug 24 19:47:05 2010	(r24909)
@@ -282,7 +282,7 @@ DECLARE_LOOP_FILTER(sse4)
 
 av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
 {
-    mm_flags = mm_support();
+    int mm_flags = mm_support();
 
 #if HAVE_YASM
     if (mm_flags & FF_MM_MMX) {



More information about the ffmpeg-cvslog mailing list