annotate libswscale/cs_test.c @ 22544:22aee0fa42a4

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