From 1808700e26023fccfabec9e65ee7e4fb18ae57f2 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Fri, 18 Aug 2006 20:50:10 +0000 Subject: [PATCH] MSVC compatibility fix from Haali git-svn-id: svn://svn.videolan.org/x264/trunk@556 df754926-b1dd-0310-bc7b-ec298dee348c --- common/common.h | 5 +++++ common/pixel.c | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/common.h b/common/common.h index ce3c27b5..a3973420 100644 --- a/common/common.h +++ b/common/common.h @@ -37,6 +37,11 @@ #define X264_VERSION "" // no configure script for msvc #endif +/* alloca */ +#ifdef _MSC_VER +#define alloca _alloca +#endif + /* threads */ #ifdef __WIN32__ #include diff --git a/common/pixel.c b/common/pixel.c index fd557ff3..aabc69c3 100644 --- a/common/pixel.c +++ b/common/pixel.c @@ -379,9 +379,8 @@ float x264_pixel_ssim_wxh( x264_pixel_function_t *pf, { int x, y, z; float ssim = 0.0; - int sums[2][width/4+3][4]; - int (*sum0)[4] = sums[0]; - int (*sum1)[4] = sums[1]; + int (*sum0)[4] = alloca(4 * (width/4+3) * sizeof(int)); + int (*sum1)[4] = alloca(4 * (width/4+3) * sizeof(int)); width >>= 2; height >>= 2; z = 0; -- 2.47.3