summaryrefslogtreecommitdiffstats
path: root/libswscale/cs_test.c
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-03-30 22:09:13 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-03-30 22:09:13 +0000
commit75cf17e3f8fad158fa6518a517472b11a1530216 (patch)
treec16ddcc54f342e3fc1e1c7f040ffefe3d4ee43a9 /libswscale/cs_test.c
parent292cf8c61cd18b34d1e53bc3ee1a2b0b0b5807f9 (diff)
downloadmpv-75cf17e3f8fad158fa6518a517472b11a1530216.tar.bz2
mpv-75cf17e3f8fad158fa6518a517472b11a1530216.tar.xz
Handle proper compilation on Mac OS X.
Fix data alignment bug (the original purpose of the code is unclear, though). patch by Marc Hoffman, mmh pleasantst com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22847 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libswscale/cs_test.c')
-rw-r--r--libswscale/cs_test.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libswscale/cs_test.c b/libswscale/cs_test.c
index 3ebffd5775..cd0100618c 100644
--- a/libswscale/cs_test.c
+++ b/libswscale/cs_test.c
@@ -23,7 +23,6 @@
#include <unistd.h>
#include <stdlib.h>
#include <inttypes.h>
-#include <malloc.h>
#include "swscale.h"
#include "rgb2rgb.h"
@@ -32,9 +31,6 @@
#define srcByte 0x55
#define dstByte 0xBB
-#ifdef __APPLE_CC__
-#define memalign(x,y) malloc(y)
-#endif
static int cpu_caps;
@@ -64,8 +60,8 @@ static char *args_parse(int argc, char *argv[])
int main(int argc, char **argv)
{
int i, funcNum;
- uint8_t *srcBuffer= (uint8_t*)memalign(128, SIZE);
- uint8_t *dstBuffer= (uint8_t*)memalign(128, SIZE);
+ uint8_t *srcBuffer= (uint8_t*)av_malloc(SIZE);
+ uint8_t *dstBuffer= (uint8_t*)av_malloc(SIZE);
int failedNum=0;
int passedNum=0;
@@ -85,11 +81,11 @@ int main(int argc, char **argv)
for(width=32; width<64; width++){
int dstOffset;
- for(dstOffset=128; dstOffset<196; dstOffset++){
+ for(dstOffset=128; dstOffset<196; dstOffset+=4){
int srcOffset;
memset(dstBuffer, dstByte, SIZE);
- for(srcOffset=128; srcOffset<196; srcOffset++){
+ for(srcOffset=128; srcOffset<196; srcOffset+=4){
uint8_t *src= srcBuffer+srcOffset;
uint8_t *dst= dstBuffer+dstOffset;
char *name=NULL;