Index: libavcodec/vp3.c
===================================================================
--- libavcodec/vp3.c	(revision 6955)
+++ libavcodec/vp3.c	(working copy)
@@ -1503,7 +1503,7 @@
     int x;
     int m, n;
     int16_t *dequantizer;
-    DECLARE_ALIGNED_16(DCTELEM, block[64]);
+    DECLARE_ALIGNED_16_VECTOR(DCTELEM, block, 64);
     int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef;
     int motion_halfpel_index;
     uint8_t *motion_source;
Index: libavcodec/mpegvideo.c
===================================================================
--- libavcodec/mpegvideo.c	(revision 6955)
+++ libavcodec/mpegvideo.c	(working copy)
@@ -6087,7 +6087,7 @@
                         DCTELEM *block, int16_t *weight, DCTELEM *orig,
                         int n, int qscale){
     int16_t rem[64];
-    DECLARE_ALIGNED_16(DCTELEM, d1[64]);
+    DECLARE_ALIGNED_16_VECTOR(DCTELEM, d1, 64);
     const int *qmat;
     const uint8_t *scantable= s->intra_scantable.scantable;
     const uint8_t *perm_scantable= s->intra_scantable.permutated;
Index: libavcodec/dsputil.h
===================================================================
--- libavcodec/dsputil.h	(revision 6955)
+++ libavcodec/dsputil.h	(working copy)
@@ -463,12 +463,27 @@
    one or more MultiMedia extension */
 int mm_support(void);
 
-#ifdef __GNUC__
+#if defined (__GNUC__)
   #define DECLARE_ALIGNED_16(t,v)       t v __attribute__ ((aligned (16)))
+#elif defined (_MSC_VER)
+  #define DECLARE_ALIGNED_16(t,v)      __declspec(align(16)) t v
 #else
-  #define DECLARE_ALIGNED_16(t,v)      __declspec(align(16)) t v
+  #define DECLARE_ALIGNED_16(t,v)       t v
 #endif
 
+#if defined(__GNUC__)
+# if defined(_WIN32)
+#  include <malloc.h>
+#  define DECLARE_ALIGNED_16_VECTOR(t,x,s)         t *x   = (t*)  (((intptr_t)alloca(s*sizeof(t)+15)+15)&~15)
+# else
+#  define DECLARE_ALIGNED_16_VECTOR(t,x,s)         t x[s]          __attribute__ ((aligned (16)))
+# endif
+#elif defined(_MSC_VER)
+#  define DECLARE_ALIGNED_16_VECTOR(t,x,s)         __declspec(align(16)) t x[s]
+#else
+#  define DECLARE_ALIGNED_16_VECTOR(t,x,s)         t x[s]
+#endif
+
 #if defined(HAVE_MMX)
 
 #undef emms_c
Index: libavcodec/wmadec.c
===================================================================
--- libavcodec/wmadec.c	(revision 6955)
+++ libavcodec/wmadec.c	(working copy)
@@ -717,7 +717,7 @@
 {
     int n, v, a, ch, code, bsize;
     int coef_nb_bits, total_gain, parse_exponents;
-    DECLARE_ALIGNED_16(float, window[BLOCK_MAX_SIZE * 2]);
+    DECLARE_ALIGNED_16_VECTOR(float, window, BLOCK_MAX_SIZE * 2);
     int nb_coefs[MAX_CHANNELS];
     float mdct_norm;
 
@@ -1107,7 +1107,7 @@
 
     for(ch = 0; ch < s->nb_channels; ch++) {
         if (s->channel_coded[ch]) {
-            DECLARE_ALIGNED_16(FFTSample, output[BLOCK_MAX_SIZE * 2]);
+            DECLARE_ALIGNED_16_VECTOR(FFTSample, output, BLOCK_MAX_SIZE * 2);
             float *ptr;
             int n4, index, n;
 
