@@ -58,12 +58,14 @@ PR_WRAP(avx)
#endif
static const struct algo fdct_tab_arch[] = {
+#if ARCH_X86_32
#if HAVE_MMX_INLINE
{ "MMX", ff_fdct_mmx, FF_IDCT_PERM_NONE, AV_CPU_FLAG_MMX },
#endif
#if HAVE_MMXEXT_INLINE
{ "MMXEXT", ff_fdct_mmxext, FF_IDCT_PERM_NONE, AV_CPU_FLAG_MMXEXT },
#endif
+#endif
#if HAVE_SSE2_INLINE
{ "SSE2", ff_fdct_sse2, FF_IDCT_PERM_NONE, AV_CPU_FLAG_SSE2 },
#endif
@@ -71,8 +71,6 @@ DECLARE_ALIGNED(16, static const int16_t, ocos_4_16)[8] = {
DECLARE_ALIGNED(16, static const int16_t, fdct_one_corr)[8] = { X8(1) };
-DECLARE_ALIGNED(8, static const int32_t, fdct_r_row)[2] = {RND_FRW_ROW, RND_FRW_ROW };
-
static const struct
{
DECLARE_ALIGNED(16, const int32_t, fdct_r_row_sse2)[4];
@@ -375,7 +373,6 @@ static av_always_inline void fdct_col_##cpu(const int16_t *in, int16_t *out, int
"r" (out + offset), "r" (ocos_4_16)); \
}
-FDCT_COL(mmx, mm, movq)
FDCT_COL(sse2, xmm, movdqa)
static av_always_inline void fdct_row_sse2(const int16_t *in, int16_t *out)
@@ -443,6 +440,12 @@ static av_always_inline void fdct_row_sse2(const int16_t *in, int16_t *out)
);
}
+#if ARCH_X86_32
+
+DECLARE_ALIGNED(8, static const int32_t, fdct_r_row)[2] = { RND_FRW_ROW, RND_FRW_ROW };
+
+FDCT_COL(mmx, mm, movq)
+
static av_always_inline void fdct_row_mmxext(const int16_t *in, int16_t *out,
const int16_t *table)
{
@@ -559,9 +562,10 @@ void ff_fdct_mmx(int16_t *block)
}
}
+#endif /* ARCH_X86_32 */
#endif /* HAVE_MMX_INLINE */
-#if HAVE_MMXEXT_INLINE
+#if HAVE_MMXEXT_INLINE && ARCH_X86_32
void ff_fdct_mmxext(int16_t *block)
{
@@ -31,11 +31,13 @@ av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx,
if (!high_bit_depth) {
if ((dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX)) {
+#if ARCH_X86_32
if (INLINE_MMX(cpu_flags))
c->fdct = ff_fdct_mmx;
if (INLINE_MMXEXT(cpu_flags))
c->fdct = ff_fdct_mmxext;
+#endif
if (INLINE_SSE2(cpu_flags))
c->fdct = ff_fdct_sse2;
x64 always has MMX, MMXEXT, SSE and SSE2 and this means that some functions for MMX, MMXEXT, SSE and 3dnow are always overridden by other functions (unless one e.g. explicitly disables SSE2). This commit therefore disables such mpegvideoenc functions at compile-time. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/tests/x86/dct.c | 2 ++ libavcodec/x86/fdct.c | 12 ++++++++---- libavcodec/x86/fdctdsp_init.c | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-)