summaryrefslogtreecommitdiff
path: root/libavcodec/x86
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-08-24 17:47:05 +0000
committerMåns Rullgård <mans@mansr.com>2010-08-24 17:47:05 +0000
commitc0ec9918b066c6bfca8613ac75b589bd3e405971 (patch)
treed037260d347ffce71a1ccdbaca81174e190a25d1 /libavcodec/x86
parent3611c45ab757d03cf3878af62ca1c19ae8386037 (diff)
Remove global mm_flags variable
Originally committed as revision 24909 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/x86')
-rw-r--r--libavcodec/x86/dnxhd_mmx.c2
-rw-r--r--libavcodec/x86/dsputil_mmx.c6
-rw-r--r--libavcodec/x86/dsputilenc_mmx.c2
-rw-r--r--libavcodec/x86/h264dsp_mmx.c2
-rw-r--r--libavcodec/x86/motion_est_mmx.c2
-rw-r--r--libavcodec/x86/mpegaudiodec_mmx.c2
-rw-r--r--libavcodec/x86/mpegvideo_mmx.c2
-rw-r--r--libavcodec/x86/snowdsp_mmx.c2
-rw-r--r--libavcodec/x86/vc1dsp_mmx.c2
-rw-r--r--libavcodec/x86/vp8dsp-init.c2
10 files changed, 14 insertions, 10 deletions
diff --git a/libavcodec/x86/dnxhd_mmx.c b/libavcodec/x86/dnxhd_mmx.c
index 59bcb3929b..1e6299bcd1 100644
--- a/libavcodec/x86/dnxhd_mmx.c
+++ b/libavcodec/x86/dnxhd_mmx.c
@@ -52,7 +52,7 @@ static void get_pixels_8x4_sym_sse2(DCTELEM *block, const uint8_t *pixels, int l
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;
}
}
diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
index 2b96be3a33..1163e43817 100644
--- a/libavcodec/x86/dsputil_mmx.c
+++ b/libavcodec/x86/dsputil_mmx.c
@@ -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 float *v1, const float *v2, int order);
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, AVCodecContext *avctx)
#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=
diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c
index d3e412a3dc..bc24abadc7 100644
--- a/libavcodec/x86/dsputilenc_mmx.c
+++ b/libavcodec/x86/dsputilenc_mmx.c
@@ -1350,6 +1350,8 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si
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){
diff --git a/libavcodec/x86/h264dsp_mmx.c b/libavcodec/x86/h264dsp_mmx.c
index ebd87518ba..e402e420f8 100644
--- a/libavcodec/x86/h264dsp_mmx.c
+++ b/libavcodec/x86/h264dsp_mmx.c
@@ -2368,7 +2368,7 @@ void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int s
#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) {
diff --git a/libavcodec/x86/motion_est_mmx.c b/libavcodec/x86/motion_est_mmx.c
index 0272410dc5..87e7a15a47 100644
--- a/libavcodec/x86/motion_est_mmx.c
+++ b/libavcodec/x86/motion_est_mmx.c
@@ -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;
diff --git a/libavcodec/x86/mpegaudiodec_mmx.c b/libavcodec/x86/mpegaudiodec_mmx.c
index e7e1150789..f4c9b45986 100644
--- a/libavcodec/x86/mpegaudiodec_mmx.c
+++ b/libavcodec/x86/mpegaudiodec_mmx.c
@@ -149,7 +149,7 @@ static void apply_window_mp3(float *in, float *win, int *unused, float *out,
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;
diff --git a/libavcodec/x86/mpegvideo_mmx.c b/libavcodec/x86/mpegvideo_mmx.c
index 5deb68d28d..3556e1caa7 100644
--- a/libavcodec/x86/mpegvideo_mmx.c
+++ b/libavcodec/x86/mpegvideo_mmx.c
@@ -625,6 +625,8 @@ static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){
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;
diff --git a/libavcodec/x86/snowdsp_mmx.c b/libavcodec/x86/snowdsp_mmx.c
index 263f0bbf69..96b3bf29ba 100644
--- a/libavcodec/x86/snowdsp_mmx.c
+++ b/libavcodec/x86/snowdsp_mmx.c
@@ -874,7 +874,7 @@ static void ff_snow_inner_add_yblock_mmx(const uint8_t *obmc, const int obmc_str
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){
diff --git a/libavcodec/x86/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c
index 3ce097894d..eb3ad2c32f 100644
--- a/libavcodec/x86/vc1dsp_mmx.c
+++ b/libavcodec/x86/vc1dsp_mmx.c
@@ -714,7 +714,7 @@ static void vc1_h_loop_filter16_sse4(uint8_t *src, int stride, int pq)
#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;
diff --git a/libavcodec/x86/vp8dsp-init.c b/libavcodec/x86/vp8dsp-init.c
index aceec6a346..ed5cf46024 100644
--- a/libavcodec/x86/vp8dsp-init.c
+++ b/libavcodec/x86/vp8dsp-init.c
@@ -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) {