annotate libswscale/cs_test.c @ 19493:aa58338824f8

Remove backup files from the win32 subdir as well.
author diego
date Tue, 22 Aug 2006 23:04:48 +0000
parents b3939dba3c13
children f837670d269c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1 /*
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2 Copyright (C) 2002 Michael Niedermayer <michaelni@gmx.at>
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
3
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
4 This program is free software; you can redistribute it and/or modify
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
6 the Free Software Foundation; either version 2 of the License, or
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
7 (at your option) any later version.
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
8
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
12 GNU General Public License for more details.
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
13
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
15 along with this program; if not, write to the Free Software
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
17 */
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
18
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
19 #include <stdio.h>
19470
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
20 #include <string.h> /* for memset() */
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
21 #include <unistd.h>
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
22 #include <stdlib.h>
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
23 #include <inttypes.h>
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
24
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
25 #include "swscale.h"
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
26 #include "rgb2rgb.h"
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
27
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
28 #define SIZE 1000
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
29 #define srcByte 0x55
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
30 #define dstByte 0xBB
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
31
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
32 #ifdef __APPLE_CC__
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
33 #define memalign(x,y) malloc(y)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
34 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
35
19470
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
36 static int cpu_caps;
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
37
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
38 static char *args_parse(int argc, char *argv[])
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
39 {
19470
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
40 int o;
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
41
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
42 while ((o = getopt(argc, argv, "m23")) != -1) {
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
43 switch (o) {
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
44 case 'm':
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
45 cpu_caps |= SWS_CPU_CAPS_MMX;
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
46 break;
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
47 case '2':
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
48 cpu_caps |= SWS_CPU_CAPS_MMX2;
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
49 break;
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
50 case '3':
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
51 cpu_caps |= SWS_CPU_CAPS_3DNOW;
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
52 break;
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
53 default:
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
54 fprintf(stderr, "Unknown option %c\n", o);
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
55 }
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
56 }
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
57
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
58 return argv[optind];
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
59 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
60
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
61 main(int argc, char **argv)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
62 {
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
63 int i, funcNum;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
64 uint8_t *srcBuffer= (uint8_t*)memalign(128, SIZE);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
65 uint8_t *dstBuffer= (uint8_t*)memalign(128, SIZE);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
66 int failedNum=0;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
67 int passedNum=0;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
68
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
69 printf("memory corruption test ...\n");
19470
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
70 args_parse(argc, argv);
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
71 fprintf(stderr, "CPU capabilities forced to %x\n", cpu_caps);
b3939dba3c13 Allow to compile swscale tests
lucabe
parents: 18861
diff changeset
72 sws_rgb2rgb_init(cpu_caps);
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
73
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
74 for(funcNum=0; funcNum<100; funcNum++){
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
75 int width;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
76 int failed=0;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
77 int srcBpp=0;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
78 int dstBpp=0;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
79
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
80 printf("."); fflush(stdout);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
81 memset(srcBuffer, srcByte, SIZE);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
82
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
83 for(width=32; width<64; width++){
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
84 int dstOffset;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
85 for(dstOffset=128; dstOffset<196; dstOffset++){
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
86 int srcOffset;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
87 memset(dstBuffer, dstByte, SIZE);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
88
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
89 for(srcOffset=128; srcOffset<196; srcOffset++){
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
90 uint8_t *src= srcBuffer+srcOffset;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
91 uint8_t *dst= dstBuffer+dstOffset;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
92 char *name=NULL;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
93
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
94 if(failed) break; //don't fill the screen with shit ...
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
95
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
96 switch(funcNum){
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
97 case 0:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
98 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
99 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
100 name="rgb15to16";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
101 rgb15to16(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
102 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
103 case 1:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
104 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
105 dstBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
106 name="rgb15to24";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
107 rgb15to24(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
108 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
109 case 2:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
110 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
111 dstBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
112 name="rgb15to32";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
113 rgb15to32(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
114 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
115 case 3:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
116 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
117 dstBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
118 name="rgb16to24";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
119 rgb16to24(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
120 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
121 case 4:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
122 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
123 dstBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
124 name="rgb16to32";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
125 rgb16to32(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
126 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
127 case 5:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
128 srcBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
129 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
130 name="rgb24to15";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
131 rgb24to15(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
132 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
133 case 6:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
134 srcBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
135 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
136 name="rgb24to16";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
137 rgb24to16(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
138 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
139 case 7:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
140 srcBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
141 dstBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
142 name="rgb24to32";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
143 rgb24to32(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
144 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
145 case 8:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
146 srcBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
147 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
148 name="rgb32to15";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
149 rgb32to15(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
150 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
151 case 9:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
152 srcBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
153 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
154 name="rgb32to16";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
155 rgb32to16(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
156 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
157 case 10:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
158 srcBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
159 dstBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
160 name="rgb32to24";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
161 rgb32to24(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
162 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
163 case 11:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
164 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
165 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
166 name="rgb16to15";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
167 rgb16to15(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
168 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
169
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
170 case 14:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
171 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
172 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
173 name="rgb15tobgr15";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
174 rgb15tobgr15(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
175 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
176 case 15:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
177 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
178 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
179 name="rgb15tobgr16";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
180 rgb15tobgr16(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
181 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
182 case 16:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
183 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
184 dstBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
185 name="rgb15tobgr24";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
186 rgb15tobgr24(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
187 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
188 case 17:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
189 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
190 dstBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
191 name="rgb15tobgr32";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
192 rgb15tobgr32(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
193 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
194 case 18:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
195 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
196 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
197 name="rgb16tobgr15";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
198 rgb16tobgr15(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
199 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
200 case 19:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
201 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
202 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
203 name="rgb16tobgr16";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
204 rgb16tobgr16(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
205 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
206 case 20:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
207 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
208 dstBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
209 name="rgb16tobgr24";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
210 rgb16tobgr24(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
211 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
212 case 21:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
213 srcBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
214 dstBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
215 name="rgb16tobgr32";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
216 rgb16tobgr32(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
217 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
218 case 22:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
219 srcBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
220 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
221 name="rgb24tobgr15";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
222 rgb24tobgr15(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
223 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
224 case 23:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
225 srcBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
226 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
227 name="rgb24tobgr16";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
228 rgb24tobgr16(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
229 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
230 case 24:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
231 srcBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
232 dstBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
233 name="rgb24tobgr24";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
234 rgb24tobgr24(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
235 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
236 case 25:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
237 srcBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
238 dstBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
239 name="rgb24tobgr32";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
240 rgb24tobgr32(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
241 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
242 case 26:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
243 srcBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
244 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
245 name="rgb32tobgr15";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
246 rgb32tobgr15(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
247 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
248 case 27:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
249 srcBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
250 dstBpp=2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
251 name="rgb32tobgr16";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
252 rgb32tobgr16(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
253 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
254 case 28:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
255 srcBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
256 dstBpp=3;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
257 name="rgb32tobgr24";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
258 rgb32tobgr24(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
259 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
260 case 29:
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
261 srcBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
262 dstBpp=4;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
263 name="rgb32tobgr32";
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
264 rgb32tobgr32(src, dst, width*srcBpp);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
265 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
266
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
267 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
268 if(!srcBpp) break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
269
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
270 for(i=0; i<SIZE; i++){
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
271 if(srcBuffer[i]!=srcByte){
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
272 printf("src damaged at %d w:%d src:%d dst:%d %s\n",
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
273 i, width, srcOffset, dstOffset, name);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
274 failed=1;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
275 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
276 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
277 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
278 for(i=0; i<dstOffset; i++){
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
279 if(dstBuffer[i]!=dstByte){
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
280 printf("dst damaged at %d w:%d src:%d dst:%d %s\n",
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
281 i, width, srcOffset, dstOffset, name);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
282 failed=1;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
283 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
284 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
285 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
286 for(i=dstOffset + width*dstBpp; i<SIZE; i++){
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
287 if(dstBuffer[i]!=dstByte){
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
288 printf("dst damaged at %d w:%d src:%d dst:%d %s\n",
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
289 i, width, srcOffset, dstOffset, name);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
290 failed=1;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
291 break;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
292 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
293 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
294 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
295 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
296 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
297 if(failed) failedNum++;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
298 else if(srcBpp) passedNum++;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
299 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
300
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
301 printf("%d converters passed, %d converters randomly overwrote memory\n", passedNum, failedNum);
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
302 return failedNum;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
303 }