]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/x86/mlpdsp.c
x86: hpeldsp: Drop unused function parameters
[ffmpeg] / libavcodec / x86 / mlpdsp.c
index f81c329a38cc14fab845a3986854df97c7377ab0..72fc637764dcb6275d5ba33bb91888d1012222f9 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/attributes.h"
 #include "libavutil/internal.h"
+#include "libavutil/cpu.h"
 #include "libavutil/x86/asm.h"
-#include "libavcodec/dsputil.h"
+#include "libavutil/x86/cpu.h"
+#include "libavcodec/mlpdsp.h"
 #include "libavcodec/mlp.h"
 
-#if HAVE_7REGS
+#if HAVE_7REGS && HAVE_INLINE_ASM
 
 extern char ff_mlp_firorder_8;
 extern char ff_mlp_firorder_7;
@@ -172,11 +175,13 @@ static void mlp_filter_channel_x86(int32_t *state, const int32_t *coeff,
     );
 }
 
-#endif /* HAVE_7REGS */
+#endif /* HAVE_7REGS && HAVE_INLINE_ASM */
 
-void ff_mlp_init_x86(DSPContext* c, AVCodecContext *avctx)
+av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
 {
-#if HAVE_7REGS
-    c->mlp_filter_channel = mlp_filter_channel_x86;
+#if HAVE_7REGS && HAVE_INLINE_ASM
+    int cpu_flags = av_get_cpu_flags();
+    if (INLINE_MMX(cpu_flags))
+        c->mlp_filter_channel = mlp_filter_channel_x86;
 #endif
 }