changeset 33415:53073a44a899

Fix build after removal of SWS_CPU_CAPS_* from libswscale in FFmpeg. Remove the get_sws_cpuflags() and its uses across filters.
author iive
date Wed, 25 May 2011 13:46:32 +0000
parents 9bc9e1851a13
children b7b169f5abda
files libmpcodecs/vf_halfpack.c libmpcodecs/vf_sab.c libmpcodecs/vf_scale.c libmpcodecs/vf_scale.h libmpcodecs/vf_smartblur.c
diffstat 5 files changed, 6 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_halfpack.c	Tue May 24 20:52:27 2011 +0000
+++ b/libmpcodecs/vf_halfpack.c	Wed May 25 13:46:32 2011 +0000
@@ -200,7 +200,7 @@
 		vf->priv->ctx =
 			sws_getContext(width, height / 2, PIX_FMT_YUV422P,
 			               width, height / 2, PIX_FMT_YUYV422,
-			               SWS_POINT | SWS_PRINT_INFO | get_sws_cpuflags(),
+			               SWS_POINT | SWS_PRINT_INFO,
 			               NULL, NULL, NULL);
 	}
 	/* FIXME - also support UYVY output? */
--- a/libmpcodecs/vf_sab.c	Tue May 24 20:52:27 2011 +0000
+++ b/libmpcodecs/vf_sab.c	Wed May 25 13:46:32 2011 +0000
@@ -104,7 +104,7 @@
     swsF.lumH= swsF.lumV= vec;
     swsF.chrH= swsF.chrV= NULL;
     f->preFilterContext= sws_getContext(
-        width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, get_sws_cpuflags()|SWS_POINT, &swsF, NULL, NULL);
+        width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, SWS_POINT, &swsF, NULL, NULL);
 
     sws_freeVec(vec);
     vec = sws_getGaussianVec(f->strength, 5.0);
--- a/libmpcodecs/vf_scale.c	Tue May 24 20:52:27 2011 +0000
+++ b/libmpcodecs/vf_scale.c	Wed May 25 13:46:32 2011 +0000
@@ -293,13 +293,13 @@
             sfmt,
                   vf->priv->w, vf->priv->h >> vf->priv->interlaced,
             dfmt,
-            int_sws_flags | get_sws_cpuflags(), srcFilter, dstFilter, vf->priv->param);
+            int_sws_flags, srcFilter, dstFilter, vf->priv->param);
     if(vf->priv->interlaced){
         vf->priv->ctx2=sws_getContext(width, height >> 1,
             sfmt,
                   vf->priv->w, vf->priv->h >> 1,
             dfmt,
-            int_sws_flags | get_sws_cpuflags(), srcFilter, dstFilter, vf->priv->param);
+            int_sws_flags, srcFilter, dstFilter, vf->priv->param);
     }
     if(!vf->priv->ctx){
         // error...
@@ -560,13 +560,6 @@
 float sws_chr_sharpen= 0.0;
 float sws_lum_sharpen= 0.0;
 
-int get_sws_cpuflags(void){
-    return
-          (gCpuCaps.hasMMX   ? SWS_CPU_CAPS_MMX   : 0)
-        | (gCpuCaps.hasMMX2  ? SWS_CPU_CAPS_MMX2  : 0)
-        | (gCpuCaps.has3DNow ? SWS_CPU_CAPS_3DNOW : 0)
-        | (gCpuCaps.hasAltiVec ? SWS_CPU_CAPS_ALTIVEC : 0);
-}
 
 void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, SwsFilter **dstFilterParam)
 {
@@ -623,7 +616,7 @@
         if (srcFormat == IMGFMT_RGB8 || srcFormat == IMGFMT_BGR8) sfmt = PIX_FMT_PAL8;
         sws_getFlagsAndFilterFromCmdLine(&flags, &srcFilterParam, &dstFilterParam);
 
-        return sws_getContext(srcW, srcH, sfmt, dstW, dstH, dfmt, flags | get_sws_cpuflags(), srcFilterParam, dstFilterParam, NULL);
+        return sws_getContext(srcW, srcH, sfmt, dstW, dstH, dfmt, flags, srcFilterParam, dstFilterParam, NULL);
 }
 
 /// An example of presets usage
--- a/libmpcodecs/vf_scale.h	Tue May 24 20:52:27 2011 +0000
+++ b/libmpcodecs/vf_scale.h	Wed May 25 13:46:32 2011 +0000
@@ -29,7 +29,6 @@
 
 extern int sws_flags;
 
-int get_sws_cpuflags(void);
 struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat);
 
 #endif /* MPLAYER_VF_SCALE_H */
--- a/libmpcodecs/vf_smartblur.c	Tue May 24 20:52:27 2011 +0000
+++ b/libmpcodecs/vf_smartblur.c	Wed May 25 13:46:32 2011 +0000
@@ -89,7 +89,7 @@
     swsF.lumH= swsF.lumV= vec;
     swsF.chrH= swsF.chrV= NULL;
     f->filterContext= sws_getContext(
-        width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, SWS_BICUBIC | get_sws_cpuflags(), &swsF, NULL, NULL);
+        width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, SWS_BICUBIC, &swsF, NULL, NULL);
 
     sws_freeVec(vec);