]> git.sesse.net Git - ffmpeg/commitdiff
avcodec: remove AVCodecContext.dsp_mask
authorMans Rullgard <mans@mansr.com>
Fri, 20 Apr 2012 13:31:08 +0000 (14:31 +0100)
committerMans Rullgard <mans@mansr.com>
Sat, 21 Apr 2012 17:30:01 +0000 (18:30 +0100)
This removes all references to AVCodecContext.dsp_mask and marks
it for eviction at the next version bump.  It has been superseded
by av_set_cpu_flag_mask() which, unlike this field, works everywhere.

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavcodec/avcodec.h
libavcodec/pthread.c
libavcodec/version.h
libavcodec/x86/dsputil_mmx.c

index 92a5d0a173d33df6dc8b8209fa9cc8e80de05dc2..9e937d31b1cee37b7543be93e0de2a42e7adaf1a 100644 (file)
@@ -2559,15 +2559,13 @@ typedef struct AVCodecContext {
 #define FF_IDCT_SIMPLEALPHA   23
 #define FF_IDCT_BINK          24
 
+#if FF_API_DSP_MASK
     /**
-     * dsp_mask could be add used to disable unwanted CPU features
-     * CPU features (i.e. MMX, SSE. ...)
-     *
-     * With the FORCE flag you may instead enable given CPU features.
-     * (Dangerous: Usable in case of misdetection, improper usage however will
-     * result into program crash.)
+     * Unused.
+     * @deprecated use av_set_cpu_flags_mask() instead.
      */
-    unsigned dsp_mask;
+    attribute_deprecated unsigned dsp_mask;
+#endif
 
     /**
      * bits per sample/pixel from the demuxer (needed for huffyuv).
index dc9220adc4b6eb45524a961cd7023ffe823efc79..1889d2ae919a4df51084e167e418682ba6f0a2a8 100644 (file)
@@ -457,7 +457,6 @@ static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
     dst->release_buffer = src->release_buffer;
 
     dst->opaque   = src->opaque;
-    dst->dsp_mask = src->dsp_mask;
     dst->debug    = src->debug;
     dst->debug_mv = src->debug_mv;
 
index 58a228c4a2d6cf84886b94a5f5514d61616d28b6..5119874379b82d673433bee1d25ac387372ca75a 100644 (file)
@@ -68,5 +68,8 @@
 #ifndef FF_API_SUB_ID
 #define FF_API_SUB_ID           (LIBAVCODEC_VERSION_MAJOR < 55)
 #endif
+#ifndef FF_API_DSP_MASK
+#define FF_API_DSP_MASK         (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
 
 #endif /* AVCODEC_VERSION_H */
index 192c5c3b9590da53a07fe0759447fa399ed506a9..6695cafb65019c5fb26ec9bf7e00ec4959ac0f3f 100644 (file)
@@ -3103,13 +3103,6 @@ void ff_dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx)
 {
     int mm_flags = av_get_cpu_flags();
 
-    if (avctx->dsp_mask) {
-        if (avctx->dsp_mask & AV_CPU_FLAG_FORCE)
-            mm_flags |=   avctx->dsp_mask & 0xffff;
-        else
-            mm_flags &= ~(avctx->dsp_mask & 0xffff);
-    }
-
 #if 0
     av_log(avctx, AV_LOG_INFO, "libavcodec: CPU flags:");
     if (mm_flags & AV_CPU_FLAG_MMX)