diff --git a/MAINTAINERS b/MAINTAINERS
index 11e2035971128d728e5e0d4e84669ff54b80a089..7bfa7be081f0ee0b568a29abdde2741665284d4a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -298,7 +298,6 @@ Operating systems / CPU architectures
 Alpha                                   Mans Rullgard, Falk Hueffner
 ARM                                     Mans Rullgard
 BeOS                                    Francois Revol
-i386                                    Michael Niedermayer
 Mac OS X / PowerPC                      Romain Dolbeau, Guillaume Poirier
 Amiga / PowerPC                         Colin Ward
 Linux / PowerPC                         Luca Barbato
@@ -306,3 +305,4 @@ Windows MinGW                           Alex Beregszaszi, Ramiro Polla
 Windows Cygwin                          Victor Paesa
 ADI/Blackfin DSP                        Marc Hoffman
 Sparc                                   Roman Shaposhnik
+x86                                     Michael Niedermayer
diff --git a/README b/README
index 6274ea257806f2a8903dda97c339541cdc789eac..404c33b1c532e04f28cdc1edf09e31a297d7d96c 100644
--- a/README
+++ b/README
@@ -17,7 +17,7 @@ FFmpeg README
   License, see the file COPYING.GPL for details. Their compilation and use
   in FFmpeg is optional.
 
-* The file libavcodec/i386/idct_mmx.c is distributed under the GNU General
+* The file libavcodec/x86/idct_mmx.c is distributed under the GNU General
   Public License. It is strictly an optimization and its use is optional.
 
 * The file libavcodec/ac3dec.c is distributed under the GNU General Public
diff --git a/common.mak b/common.mak
index d4c1f14862b1b5e6849575df7658338a39a02c15..8ac6ee07adf0924173b806ae5ac164c938fa0f9f 100644
--- a/common.mak
+++ b/common.mak
@@ -91,10 +91,10 @@ $(SUBDIR)%-test.o: $(SUBDIR)%.c
 $(SUBDIR)%-test.o: $(SUBDIR)%-test.c
 	$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
 
-$(SUBDIR)i386/%.o: $(SUBDIR)i386/%.asm
+$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
 	$(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
 
-$(SUBDIR)i386/%.d: $(SUBDIR)i386/%.asm
+$(SUBDIR)x86/%.d: $(SUBDIR)x86/%.asm
 	$(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
 
 clean::
diff --git a/configure b/configure
index 4d23c9c57cce55931225631ffb98eb651ff0a6d9..8f71422920dfedefa424163cef5da7eac1f72d23 100755
--- a/configure
+++ b/configure
@@ -2359,11 +2359,11 @@ if enabled source_path_used; then
         libavcodec/alpha  \
         libavcodec/arm    \
         libavcodec/bfin   \
-        libavcodec/i386   \
         libavcodec/mlib   \
         libavcodec/ppc    \
         libavcodec/sh4    \
         libavcodec/sparc  \
+        libavcodec/x86    \
         libavdevice       \
         libavfilter       \
         libavformat       \
diff --git a/doc/optimization.txt b/doc/optimization.txt
index 50630e72ba35302e524202cabc049e01fa770fcf..ddfaecde6e088597270a4fc8a110e1fc772f6a02 100644
--- a/doc/optimization.txt
+++ b/doc/optimization.txt
@@ -4,11 +4,11 @@ optimization Tips (for libavcodec):
 What to optimize:
 -----------------
 If you plan to do non-x86 architecture specific optimizations (SIMD normally),
-then take a look in the i386/ directory, as most important functions are
+then take a look in the x86/ directory, as most important functions are
 already optimized for MMX.
 
 If you want to do x86 optimizations then you can either try to finetune the
-stuff in the i386 directory or find some other functions in the C source to
+stuff in the x86 directory or find some other functions in the C source to
 optimize, but there aren't many left.
 
 
@@ -20,7 +20,7 @@ architecture-specific versions. It is recommended to look at older
 revisions of the interesting files (for a web frontend try ViewVC at
 http://svn.mplayerhq.hu/ffmpeg/trunk/).
 Alternatively, look into the other architecture-specific versions in
-the i386/, ppc/, alpha/ subdirectories. Even if you don't exactly
+the x86/, ppc/, alpha/ subdirectories. Even if you don't exactly
 comprehend the instructions, it could help understanding the functions
 and how they can be optimized.
 
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index e4fb30d6e9a6c2fe01af2e74ca29d1d454e7f229..4786d669510623eed8e4b64bf20942bee1cf14b2 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -392,37 +392,37 @@ OBJS-$(HAVE_PTHREADS)                  += pthread.o
 OBJS-$(HAVE_W32THREADS)                += w32thread.o
 
 # processor-specific code
-MMX-OBJS-$(CONFIG_CAVS_DECODER)        += i386/cavsdsp_mmx.o
-MMX-OBJS-$(CONFIG_ENCODERS)            += i386/dsputilenc_mmx.o
-MMX-OBJS-$(CONFIG_FLAC_ENCODER)        += i386/flacdsp_mmx.o
-MMX-OBJS-$(CONFIG_GPL)                 += i386/idct_mmx.o
-MMX-OBJS-$(CONFIG_SNOW_DECODER)        += i386/snowdsp_mmx.o
-MMX-OBJS-$(CONFIG_THEORA_DECODER)      += i386/vp3dsp_mmx.o i386/vp3dsp_sse2.o
-MMX-OBJS-$(CONFIG_VC1_DECODER)         += i386/vc1dsp_mmx.o
-MMX-OBJS-$(CONFIG_VP3_DECODER)         += i386/vp3dsp_mmx.o i386/vp3dsp_sse2.o
-MMX-OBJS-$(CONFIG_VP5_DECODER)         += i386/vp3dsp_mmx.o i386/vp3dsp_sse2.o
-MMX-OBJS-$(CONFIG_VP6_DECODER)         += i386/vp3dsp_mmx.o i386/vp3dsp_sse2.o
-MMX-OBJS-$(CONFIG_VP6A_DECODER)        += i386/vp3dsp_mmx.o i386/vp3dsp_sse2.o
-MMX-OBJS-$(CONFIG_VP6F_DECODER)        += i386/vp3dsp_mmx.o i386/vp3dsp_sse2.o
-MMX-OBJS-$(CONFIG_WMV3_DECODER)        += i386/vc1dsp_mmx.o
-MMX-OBJS-$(HAVE_YASM)                  += i386/dsputil_yasm.o \
-                                          i386/h264_deblock_sse2.o
-
-OBJS-$(HAVE_MMX)                       += i386/cpuid.o                  \
-                                          i386/dnxhd_mmx.o              \
-                                          i386/dsputil_mmx.o            \
-                                          i386/fdct_mmx.o               \
-                                          i386/idct_mmx_xvid.o          \
-                                          i386/idct_sse2_xvid.o         \
-                                          i386/motion_est_mmx.o         \
-                                          i386/mpegvideo_mmx.o          \
-                                          i386/simple_idct_mmx.o        \
+MMX-OBJS-$(CONFIG_CAVS_DECODER)        += x86/cavsdsp_mmx.o
+MMX-OBJS-$(CONFIG_ENCODERS)            += x86/dsputilenc_mmx.o
+MMX-OBJS-$(CONFIG_FLAC_ENCODER)        += x86/flacdsp_mmx.o
+MMX-OBJS-$(CONFIG_GPL)                 += x86/idct_mmx.o
+MMX-OBJS-$(CONFIG_SNOW_DECODER)        += x86/snowdsp_mmx.o
+MMX-OBJS-$(CONFIG_THEORA_DECODER)      += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o
+MMX-OBJS-$(CONFIG_VC1_DECODER)         += x86/vc1dsp_mmx.o
+MMX-OBJS-$(CONFIG_VP3_DECODER)         += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o
+MMX-OBJS-$(CONFIG_VP5_DECODER)         += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o
+MMX-OBJS-$(CONFIG_VP6_DECODER)         += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o
+MMX-OBJS-$(CONFIG_VP6A_DECODER)        += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o
+MMX-OBJS-$(CONFIG_VP6F_DECODER)        += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o
+MMX-OBJS-$(CONFIG_WMV3_DECODER)        += x86/vc1dsp_mmx.o
+MMX-OBJS-$(HAVE_YASM)                  += x86/dsputil_yasm.o            \
+                                          x86/h264_deblock_sse2.o       \
+
+OBJS-$(HAVE_MMX)                       += x86/cpuid.o                   \
+                                          x86/dnxhd_mmx.o               \
+                                          x86/dsputil_mmx.o             \
+                                          x86/fdct_mmx.o                \
+                                          x86/idct_mmx_xvid.o           \
+                                          x86/idct_sse2_xvid.o          \
+                                          x86/motion_est_mmx.o          \
+                                          x86/mpegvideo_mmx.o           \
+                                          x86/simple_idct_mmx.o         \
                                           $(MMX-OBJS-yes)
 
-OBJS-$(CONFIG_FFT_MMX)                 += i386/fft_3dn.o                \
-                                          i386/fft_3dn2.o               \
-                                          i386/fft_mmx.o                \
-                                          i386/fft_sse.o                \
+OBJS-$(CONFIG_FFT_MMX)                 += x86/fft_3dn.o                 \
+                                          x86/fft_3dn2.o                \
+                                          x86/fft_mmx.o                 \
+                                          x86/fft_sse.o                 \
 
 OBJS-$(ARCH_ALPHA)                     += alpha/dsputil_alpha.o         \
                                           alpha/dsputil_alpha_asm.o     \
@@ -498,10 +498,10 @@ OBJS-$(HAVE_VIS)                       += sparc/dsputil_vis.o           \
 
 TESTS = $(addsuffix -test$(EXESUF), cabac dct eval fft h264 rangecoder snow)
 TESTS-$(CONFIG_OLDSCALER) += imgresample-test$(EXESUF)
-TESTS-$(ARCH_X86) += i386/cpuid-test$(EXESUF) motion-test$(EXESUF)
+TESTS-$(ARCH_X86) += x86/cpuid-test$(EXESUF) motion-test$(EXESUF)
 
 CLEANFILES = apiexample$(EXESUF)
-DIRS = alpha arm bfin i386 mlib ppc ps2 sh4 sparc
+DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86
 
 include $(SUBDIR)../subdir.mak
 
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index 53b4f3de148f7806cb56e9c81b45b2a1d629e81a..04f75b05f6efe7507faad5c1403210a239d38048 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -38,7 +38,7 @@
 #include "aandcttab.h"
 #include "faandct.h"
 #include "faanidct.h"
-#include "i386/idct_xvid.h"
+#include "x86/idct_xvid.h"
 
 #undef printf
 #undef random
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index c3e26c5ce3a3eb6988d097f89ea3adb31940d175..30d7b748ea2a3ef001732f9c2f33d3da400fade6 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -36,7 +36,7 @@
 
 #include "cabac.h"
 #ifdef ARCH_X86
-#include "i386/h264_i386.h"
+#include "x86/h264_i386.h"
 #endif
 
 //#undef NDEBUG
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index 3b6918bf5cd60a44875aef22335341161225ae9c..f5d9f85937f58483099c9e0270ce709fbbab1bc9 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -35,8 +35,8 @@
 #include "colorspace.h"
 
 #ifdef HAVE_MMX
-#include "i386/mmx.h"
-#include "i386/dsputil_mmx.h"
+#include "x86/mmx.h"
+#include "x86/dsputil_mmx.h"
 #endif
 
 #define xglue(x, y) x ## y
diff --git a/libavcodec/imgresample.c b/libavcodec/imgresample.c
index d1d99c5144511fc54054d7c8eee40a6033fe96ba..6ca810c6b455117852ef9cce5c50525e5080fd80 100644
--- a/libavcodec/imgresample.c
+++ b/libavcodec/imgresample.c
@@ -155,7 +155,7 @@ static void v_resample(uint8_t *dst, int dst_width, const uint8_t *src,
 
 #ifdef HAVE_MMX
 
-#include "i386/mmx.h"
+#include "x86/mmx.h"
 
 #define FILTER4(reg) \
 {\
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
index 486eed7822aeabf8e93a8e24ee9f4e342a9bc515..26405dd6f1696347797c7b983b6b1683b268a697 100644
--- a/libavcodec/mathops.h
+++ b/libavcodec/mathops.h
@@ -26,7 +26,7 @@
 
 #ifdef ARCH_X86_32
 
-#include "i386/mathops.h"
+#include "x86/mathops.h"
 
 #elif defined(ARCH_ARM)
 
diff --git a/libavcodec/i386/cavsdsp_mmx.c b/libavcodec/x86/cavsdsp_mmx.c
similarity index 100%
rename from libavcodec/i386/cavsdsp_mmx.c
rename to libavcodec/x86/cavsdsp_mmx.c
diff --git a/libavcodec/i386/cpuid.c b/libavcodec/x86/cpuid.c
similarity index 100%
rename from libavcodec/i386/cpuid.c
rename to libavcodec/x86/cpuid.c
diff --git a/libavcodec/i386/dnxhd_mmx.c b/libavcodec/x86/dnxhd_mmx.c
similarity index 100%
rename from libavcodec/i386/dnxhd_mmx.c
rename to libavcodec/x86/dnxhd_mmx.c
diff --git a/libavcodec/i386/dsputil_h264_template_mmx.c b/libavcodec/x86/dsputil_h264_template_mmx.c
similarity index 100%
rename from libavcodec/i386/dsputil_h264_template_mmx.c
rename to libavcodec/x86/dsputil_h264_template_mmx.c
diff --git a/libavcodec/i386/dsputil_h264_template_ssse3.c b/libavcodec/x86/dsputil_h264_template_ssse3.c
similarity index 100%
rename from libavcodec/i386/dsputil_h264_template_ssse3.c
rename to libavcodec/x86/dsputil_h264_template_ssse3.c
diff --git a/libavcodec/i386/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
similarity index 100%
rename from libavcodec/i386/dsputil_mmx.c
rename to libavcodec/x86/dsputil_mmx.c
diff --git a/libavcodec/i386/dsputil_mmx.h b/libavcodec/x86/dsputil_mmx.h
similarity index 97%
rename from libavcodec/i386/dsputil_mmx.h
rename to libavcodec/x86/dsputil_mmx.h
index 7ff4cd695269bf29e199339f82ffc4d0b129333b..87617e30165b87d515073de6cfce92b0bd1535ef 100644
--- a/libavcodec/i386/dsputil_mmx.h
+++ b/libavcodec/x86/dsputil_mmx.h
@@ -19,8 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AVCODEC_I386_DSPUTIL_MMX_H
-#define AVCODEC_I386_DSPUTIL_MMX_H
+#ifndef AVCODEC_X86_DSPUTIL_MMX_H
+#define AVCODEC_X86_DSPUTIL_MMX_H
 
 #include <stdint.h>
 #include "libavcodec/dsputil.h"
@@ -151,4 +151,4 @@ extern const double ff_pd_2[2];
 
 void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx);
 
-#endif /* AVCODEC_I386_DSPUTIL_MMX_H */
+#endif /* AVCODEC_X86_DSPUTIL_MMX_H */
diff --git a/libavcodec/i386/dsputil_mmx_avg_template.c b/libavcodec/x86/dsputil_mmx_avg_template.c
similarity index 100%
rename from libavcodec/i386/dsputil_mmx_avg_template.c
rename to libavcodec/x86/dsputil_mmx_avg_template.c
diff --git a/libavcodec/i386/dsputil_mmx_qns_template.c b/libavcodec/x86/dsputil_mmx_qns_template.c
similarity index 100%
rename from libavcodec/i386/dsputil_mmx_qns_template.c
rename to libavcodec/x86/dsputil_mmx_qns_template.c
diff --git a/libavcodec/i386/dsputil_mmx_rnd_template.c b/libavcodec/x86/dsputil_mmx_rnd_template.c
similarity index 100%
rename from libavcodec/i386/dsputil_mmx_rnd_template.c
rename to libavcodec/x86/dsputil_mmx_rnd_template.c
diff --git a/libavcodec/i386/dsputil_yasm.asm b/libavcodec/x86/dsputil_yasm.asm
similarity index 100%
rename from libavcodec/i386/dsputil_yasm.asm
rename to libavcodec/x86/dsputil_yasm.asm
diff --git a/libavcodec/i386/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c
similarity index 100%
rename from libavcodec/i386/dsputilenc_mmx.c
rename to libavcodec/x86/dsputilenc_mmx.c
diff --git a/libavcodec/i386/fdct_mmx.c b/libavcodec/x86/fdct_mmx.c
similarity index 100%
rename from libavcodec/i386/fdct_mmx.c
rename to libavcodec/x86/fdct_mmx.c
diff --git a/libavcodec/i386/fft_3dn.c b/libavcodec/x86/fft_3dn.c
similarity index 100%
rename from libavcodec/i386/fft_3dn.c
rename to libavcodec/x86/fft_3dn.c
diff --git a/libavcodec/i386/fft_3dn2.c b/libavcodec/x86/fft_3dn2.c
similarity index 100%
rename from libavcodec/i386/fft_3dn2.c
rename to libavcodec/x86/fft_3dn2.c
diff --git a/libavcodec/i386/fft_mmx.asm b/libavcodec/x86/fft_mmx.asm
similarity index 100%
rename from libavcodec/i386/fft_mmx.asm
rename to libavcodec/x86/fft_mmx.asm
diff --git a/libavcodec/i386/fft_sse.c b/libavcodec/x86/fft_sse.c
similarity index 100%
rename from libavcodec/i386/fft_sse.c
rename to libavcodec/x86/fft_sse.c
diff --git a/libavcodec/i386/flacdsp_mmx.c b/libavcodec/x86/flacdsp_mmx.c
similarity index 100%
rename from libavcodec/i386/flacdsp_mmx.c
rename to libavcodec/x86/flacdsp_mmx.c
diff --git a/libavcodec/i386/h264_deblock_sse2.asm b/libavcodec/x86/h264_deblock_sse2.asm
similarity index 100%
rename from libavcodec/i386/h264_deblock_sse2.asm
rename to libavcodec/x86/h264_deblock_sse2.asm
diff --git a/libavcodec/i386/h264_i386.h b/libavcodec/x86/h264_i386.h
similarity index 98%
rename from libavcodec/i386/h264_i386.h
rename to libavcodec/x86/h264_i386.h
index ed62dd6c2e49e293172aeb456ff5526db47799b2..909c27490d5a6db709b58aa77d00bf9f192db938 100644
--- a/libavcodec/i386/h264_i386.h
+++ b/libavcodec/x86/h264_i386.h
@@ -26,8 +26,8 @@
  * @author Michael Niedermayer <michaelni@gmx.at>
  */
 
-#ifndef AVCODEC_I386_H264_I386_H
-#define AVCODEC_I386_H264_I386_H
+#ifndef AVCODEC_X86_H264_I386_H
+#define AVCODEC_X86_H264_I386_H
 
 #include "libavcodec/cabac.h"
 
@@ -152,4 +152,4 @@ static int decode_significance_8x8_x86(CABACContext *c,
 #endif /* defined(ARCH_X86) && defined(HAVE_7REGS) &&                 */
        /* defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */
 
-#endif /* AVCODEC_I386_H264_I386_H */
+#endif /* AVCODEC_X86_H264_I386_H */
diff --git a/libavcodec/i386/h264dsp_mmx.c b/libavcodec/x86/h264dsp_mmx.c
similarity index 100%
rename from libavcodec/i386/h264dsp_mmx.c
rename to libavcodec/x86/h264dsp_mmx.c
diff --git a/libavcodec/i386/idct_mmx.c b/libavcodec/x86/idct_mmx.c
similarity index 100%
rename from libavcodec/i386/idct_mmx.c
rename to libavcodec/x86/idct_mmx.c
diff --git a/libavcodec/i386/idct_mmx_xvid.c b/libavcodec/x86/idct_mmx_xvid.c
similarity index 100%
rename from libavcodec/i386/idct_mmx_xvid.c
rename to libavcodec/x86/idct_mmx_xvid.c
diff --git a/libavcodec/i386/idct_sse2_xvid.c b/libavcodec/x86/idct_sse2_xvid.c
similarity index 100%
rename from libavcodec/i386/idct_sse2_xvid.c
rename to libavcodec/x86/idct_sse2_xvid.c
diff --git a/libavcodec/i386/idct_xvid.h b/libavcodec/x86/idct_xvid.h
similarity index 91%
rename from libavcodec/i386/idct_xvid.h
rename to libavcodec/x86/idct_xvid.h
index 0bf45d5d11219ec095a0ae3a47afbc002d6bfe19..bddbdb95c09e5e6ce23c9a5ec7cf559a552d0061 100644
--- a/libavcodec/i386/idct_xvid.h
+++ b/libavcodec/x86/idct_xvid.h
@@ -23,8 +23,8 @@
  * header for Xvid IDCT functions
  */
 
-#ifndef AVCODEC_I386_IDCT_XVID_H
-#define AVCODEC_I386_IDCT_XVID_H
+#ifndef AVCODEC_X86_IDCT_XVID_H
+#define AVCODEC_X86_IDCT_XVID_H
 
 #include <stdint.h>
 
@@ -34,4 +34,4 @@ void ff_idct_xvid_sse2(short *block);
 void ff_idct_xvid_sse2_put(uint8_t *dest, int line_size, short *block);
 void ff_idct_xvid_sse2_add(uint8_t *dest, int line_size, short *block);
 
-#endif /* AVCODEC_I386_IDCT_XVID_H */
+#endif /* AVCODEC_X86_IDCT_XVID_H */
diff --git a/libavcodec/i386/mathops.h b/libavcodec/x86/mathops.h
similarity index 93%
rename from libavcodec/i386/mathops.h
rename to libavcodec/x86/mathops.h
index 77c72d85eae63b7b6c5d15a8ffc21d90fb85e87a..95377acab8022074e5a1ada15ff5b6dc55ab5e25 100644
--- a/libavcodec/i386/mathops.h
+++ b/libavcodec/x86/mathops.h
@@ -19,8 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AVCODEC_I386_MATHOPS_H
-#define AVCODEC_I386_MATHOPS_H
+#ifndef AVCODEC_X86_MATHOPS_H
+#define AVCODEC_X86_MATHOPS_H
 
 #define MULL(ra, rb, shift) \
         ({ int rt, dummy; __asm__ (\
@@ -40,4 +40,4 @@
      __asm__ ("imull %2\n\t" : "=A"(rt) : "a" ((int)ra), "g" ((int)rb));\
      rt; })
 
-#endif /* AVCODEC_I386_MATHOPS_H */
+#endif /* AVCODEC_X86_MATHOPS_H */
diff --git a/libavcodec/i386/mmx.h b/libavcodec/x86/mmx.h
similarity index 99%
rename from libavcodec/i386/mmx.h
rename to libavcodec/x86/mmx.h
index eaf7a0594a6ac2e5fe10f24e72fcaeb20f23975d..d7a76bbd7d59f3e838047c8abb92962f0fa844e2 100644
--- a/libavcodec/i386/mmx.h
+++ b/libavcodec/x86/mmx.h
@@ -18,8 +18,8 @@
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
-#ifndef AVCODEC_I386_MMX_H
-#define AVCODEC_I386_MMX_H
+#ifndef AVCODEC_X86_MMX_H
+#define AVCODEC_X86_MMX_H
 
 #warning Everything in this header is deprecated, use plain __asm__()! New code using this header will be rejected.
 
@@ -264,4 +264,4 @@
 #define         punpckhqdq_r2r(regs,regd)   mmx_r2r (punpckhqdq, regs, regd)
 
 
-#endif /* AVCODEC_I386_MMX_H */
+#endif /* AVCODEC_X86_MMX_H */
diff --git a/libavcodec/i386/motion_est_mmx.c b/libavcodec/x86/motion_est_mmx.c
similarity index 100%
rename from libavcodec/i386/motion_est_mmx.c
rename to libavcodec/x86/motion_est_mmx.c
diff --git a/libavcodec/i386/mpegvideo_mmx.c b/libavcodec/x86/mpegvideo_mmx.c
similarity index 100%
rename from libavcodec/i386/mpegvideo_mmx.c
rename to libavcodec/x86/mpegvideo_mmx.c
diff --git a/libavcodec/i386/mpegvideo_mmx_template.c b/libavcodec/x86/mpegvideo_mmx_template.c
similarity index 100%
rename from libavcodec/i386/mpegvideo_mmx_template.c
rename to libavcodec/x86/mpegvideo_mmx_template.c
diff --git a/libavcodec/i386/simple_idct_mmx.c b/libavcodec/x86/simple_idct_mmx.c
similarity index 100%
rename from libavcodec/i386/simple_idct_mmx.c
rename to libavcodec/x86/simple_idct_mmx.c
diff --git a/libavcodec/i386/snowdsp_mmx.c b/libavcodec/x86/snowdsp_mmx.c
similarity index 100%
rename from libavcodec/i386/snowdsp_mmx.c
rename to libavcodec/x86/snowdsp_mmx.c
diff --git a/libavcodec/i386/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c
similarity index 100%
rename from libavcodec/i386/vc1dsp_mmx.c
rename to libavcodec/x86/vc1dsp_mmx.c
diff --git a/libavcodec/i386/vp3dsp_mmx.c b/libavcodec/x86/vp3dsp_mmx.c
similarity index 100%
rename from libavcodec/i386/vp3dsp_mmx.c
rename to libavcodec/x86/vp3dsp_mmx.c
diff --git a/libavcodec/i386/vp3dsp_mmx.h b/libavcodec/x86/vp3dsp_mmx.h
similarity index 92%
rename from libavcodec/i386/vp3dsp_mmx.h
rename to libavcodec/x86/vp3dsp_mmx.h
index 2e79913deb8b94deac1120efae81446dd90e48e0..e565a33023ca707d21488c1e4a6c6467e621287e 100644
--- a/libavcodec/i386/vp3dsp_mmx.h
+++ b/libavcodec/x86/vp3dsp_mmx.h
@@ -19,8 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AVCODEC_I386_VP3DSP_MMX_H
-#define AVCODEC_I386_VP3DSP_MMX_H
+#ifndef AVCODEC_X86_VP3DSP_MMX_H
+#define AVCODEC_X86_VP3DSP_MMX_H
 
 #include <stdint.h>
 #include "libavcodec/dsputil.h"
@@ -32,4 +32,4 @@ void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block);
 void ff_vp3_v_loop_filter_mmx2(uint8_t *src, int stride, int *bounding_values);
 void ff_vp3_h_loop_filter_mmx2(uint8_t *src, int stride, int *bounding_values);
 
-#endif /* AVCODEC_I386_VP3DSP_MMX_H */
+#endif /* AVCODEC_X86_VP3DSP_MMX_H */
diff --git a/libavcodec/i386/vp3dsp_sse2.c b/libavcodec/x86/vp3dsp_sse2.c
similarity index 100%
rename from libavcodec/i386/vp3dsp_sse2.c
rename to libavcodec/x86/vp3dsp_sse2.c
diff --git a/libavcodec/i386/vp3dsp_sse2.h b/libavcodec/x86/vp3dsp_sse2.h
similarity index 90%
rename from libavcodec/i386/vp3dsp_sse2.h
rename to libavcodec/x86/vp3dsp_sse2.h
index 55908c22a04e4a8431fdb186688e6cad7cbb8b3f..9094620eb2a7e47a0abbbef02e7081c34015931d 100644
--- a/libavcodec/i386/vp3dsp_sse2.h
+++ b/libavcodec/x86/vp3dsp_sse2.h
@@ -19,8 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AVCODEC_I386_VP3DSP_SSE2_H
-#define AVCODEC_I386_VP3DSP_SSE2_H
+#ifndef AVCODEC_X86_VP3DSP_SSE2_H
+#define AVCODEC_X86_VP3DSP_SSE2_H
 
 #include "libavcodec/dsputil.h"
 
@@ -28,4 +28,4 @@ void ff_vp3_idct_sse2(int16_t *input_data);
 void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, DCTELEM *block);
 void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, DCTELEM *block);
 
-#endif /* AVCODEC_I386_VP3DSP_SSE2_H */
+#endif /* AVCODEC_X86_VP3DSP_SSE2_H */
diff --git a/libavcodec/i386/x86inc.asm b/libavcodec/x86/x86inc.asm
similarity index 100%
rename from libavcodec/i386/x86inc.asm
rename to libavcodec/x86/x86inc.asm