fdct: Move x86-specific declarations to a header in the x86 directory
authorDiego Biurrun <diego@biurrun.de>
Tue, 18 Feb 2014 12:16:11 +0000 (13:16 +0100)
committerDiego Biurrun <diego@biurrun.de>
Sat, 19 Jul 2014 09:25:59 +0000 (02:25 -0700)
libavcodec/dct-test.c
libavcodec/dct.h
libavcodec/x86/fdct.c
libavcodec/x86/fdct.h [copied from libavcodec/x86/fdctdsp_init.c with 50% similarity]
libavcodec/x86/fdctdsp_init.c
libavcodec/x86/mpegvideoenc_template.c

index 4f21964..8a601df 100644 (file)
@@ -45,6 +45,7 @@
 #include "aandcttab.h"
 #include "faandct.h"
 #include "faanidct.h"
+#include "x86/fdct.h"
 #include "x86/idct_xvid.h"
 #include "dctref.h"
 
index 3de10b9..3fd4e27 100644 (file)
@@ -60,8 +60,4 @@ void ff_fdct248_islow_10(int16_t *data);
 
 void ff_j_rev_dct(int16_t *data);
 
-void ff_fdct_mmx(int16_t *block);
-void ff_fdct_mmxext(int16_t *block);
-void ff_fdct_sse2(int16_t *block);
-
 #endif /* AVCODEC_DCT_H */
index 6c95439..6528b57 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "libavutil/common.h"
 #include "libavutil/x86/asm.h"
-#include "libavcodec/dct.h"
+#include "fdct.h"
 
 #if HAVE_MMX_INLINE
 
similarity index 50%
copy from libavcodec/x86/fdctdsp_init.c
copy to libavcodec/x86/fdct.h
index 93fdd65..c94a977 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/dct.h"
-#include "libavcodec/fdctdsp.h"
+#ifndef AVCODEC_X86_FDCT_H
+#define AVCODEC_X86_FDCT_H
 
-av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx,
-                                 unsigned high_bit_depth)
-{
-    int cpu_flags = av_get_cpu_flags();
-    const int dct_algo = avctx->dct_algo;
+#include <stdint.h>
 
-    if (!high_bit_depth) {
-        if ((dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX)) {
-            if (INLINE_MMX(cpu_flags))
-                c->fdct = ff_fdct_mmx;
+void ff_fdct_mmx(int16_t *block);
+void ff_fdct_mmxext(int16_t *block);
+void ff_fdct_sse2(int16_t *block);
 
-            if (INLINE_MMXEXT(cpu_flags))
-                c->fdct = ff_fdct_mmxext;
-
-            if (INLINE_SSE2(cpu_flags))
-                c->fdct = ff_fdct_sse2;
-        }
-    }
-}
+#endif /* AVCODEC_X86_FDCT_H */
index 93fdd65..4e8e4eb 100644 (file)
@@ -20,8 +20,8 @@
 #include "libavutil/cpu.h"
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/avcodec.h"
-#include "libavcodec/dct.h"
 #include "libavcodec/fdctdsp.h"
+#include "fdct.h"
 
 av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx,
                                  unsigned high_bit_depth)
index 87965fe..1274c13 100644 (file)
@@ -25,6 +25,7 @@
 #include "libavutil/internal.h"
 #include "libavutil/x86/asm.h"
 #include "libavcodec/mpegvideo.h"
+#include "fdct.h"
 
 #undef MMREG_WIDTH
 #undef MM