From 95510be8c35753da8f48062b28b65e7acdab965f Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Fri, 20 Apr 2012 14:31:08 +0100 Subject: [PATCH] avcodec: remove AVCodecContext.dsp_mask 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 --- libavcodec/avcodec.h | 12 +++++------- libavcodec/pthread.c | 1 - libavcodec/version.h | 3 +++ libavcodec/x86/dsputil_mmx.c | 7 ------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 92a5d0a173..9e937d31b1 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -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). diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index dc9220adc4..1889d2ae91 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -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; diff --git a/libavcodec/version.h b/libavcodec/version.h index 58a228c4a2..5119874379 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -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 */ diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 192c5c3b95..6695cafb65 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -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)