Allow to compile swscale tests
Originally committed as revision 19476 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
This commit is contained in:
parent
eb6447766d
commit
7f3f497a0b
@ -21,3 +21,9 @@ endif
|
|||||||
HEADERS = swscale.h rgb2rgb.h
|
HEADERS = swscale.h rgb2rgb.h
|
||||||
|
|
||||||
include $(SRC_PATH)/common.mak
|
include $(SRC_PATH)/common.mak
|
||||||
|
|
||||||
|
cs_test: cs_test.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $^ -L. -lswscale -L$(SRC_PATH)/libavutil -lavutil -lm
|
||||||
|
|
||||||
|
swscale-example: swscale-example.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $^ -L. -lswscale -L$(SRC_PATH)/libavutil -lavutil -lm
|
||||||
|
@ -17,12 +17,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h> /* for memset() */
|
||||||
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "swscale.h"
|
#include "swscale.h"
|
||||||
#include "rgb2rgb.h"
|
#include "rgb2rgb.h"
|
||||||
#include "cpudetect.h"
|
|
||||||
|
|
||||||
#define SIZE 1000
|
#define SIZE 1000
|
||||||
#define srcByte 0x55
|
#define srcByte 0x55
|
||||||
@ -32,11 +33,29 @@
|
|||||||
#define memalign(x,y) malloc(y)
|
#define memalign(x,y) malloc(y)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int get_sws_cpuflags()
|
static int cpu_caps;
|
||||||
|
|
||||||
|
static char *args_parse(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
return (gCpuCaps.hasMMX ? SWS_CPU_CAPS_MMX : 0) |
|
int o;
|
||||||
(gCpuCaps.hasMMX2 ? SWS_CPU_CAPS_MMX2 : 0) |
|
|
||||||
(gCpuCaps.has3DNow ? SWS_CPU_CAPS_3DNOW : 0);
|
while ((o = getopt(argc, argv, "m23")) != -1) {
|
||||||
|
switch (o) {
|
||||||
|
case 'm':
|
||||||
|
cpu_caps |= SWS_CPU_CAPS_MMX;
|
||||||
|
break;
|
||||||
|
case '2':
|
||||||
|
cpu_caps |= SWS_CPU_CAPS_MMX2;
|
||||||
|
break;
|
||||||
|
case '3':
|
||||||
|
cpu_caps |= SWS_CPU_CAPS_3DNOW;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fprintf(stderr, "Unknown option %c\n", o);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return argv[optind];
|
||||||
}
|
}
|
||||||
|
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
@ -48,13 +67,9 @@ main(int argc, char **argv)
|
|||||||
int passedNum=0;
|
int passedNum=0;
|
||||||
|
|
||||||
printf("memory corruption test ...\n");
|
printf("memory corruption test ...\n");
|
||||||
|
args_parse(argc, argv);
|
||||||
if(argc==2){
|
fprintf(stderr, "CPU capabilities forced to %x\n", cpu_caps);
|
||||||
GetCpuCaps(&gCpuCaps);
|
sws_rgb2rgb_init(cpu_caps);
|
||||||
printf("testing mmx\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
sws_rgb2rgb_init(get_sws_cpuflags());
|
|
||||||
|
|
||||||
for(funcNum=0; funcNum<100; funcNum++){
|
for(funcNum=0; funcNum<100; funcNum++){
|
||||||
int width;
|
int width;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user