Mercurial > mplayer.hg
annotate libswscale/colorspace-test.c @ 29463:d3c577bcd1dd
swscale-example: Remove hack to end loop by setting variables to break.
author | ramiro |
---|---|
date | Thu, 13 Aug 2009 11:48:06 +0000 |
parents | 15e1d6124a6b |
children | a4d8dee13834 |
rev | line source |
---|---|
29032
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
1 /* |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
2 * Copyright (C) 2002 Michael Niedermayer <michaelni@gmx.at> |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
3 * |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
4 * This file is part of FFmpeg. |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
5 * |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
6 * FFmpeg is free software; you can redistribute it and/or |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
7 * modify it under the terms of the GNU Lesser General Public |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
8 * License as published by the Free Software Foundation; either |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
9 * version 2.1 of the License, or (at your option) any later version. |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
10 * |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
11 * FFmpeg is distributed in the hope that it will be useful, |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
14 * Lesser General Public License for more details. |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
15 * |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
16 * You should have received a copy of the GNU Lesser General Public |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
17 * License along with FFmpeg; if not, write to the Free Software |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
19 */ |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
20 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
21 #include <stdio.h> |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
22 #include <string.h> /* for memset() */ |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
23 #include <unistd.h> |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
24 #include <stdlib.h> |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
25 #include <inttypes.h> |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
26 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
27 #include "swscale.h" |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
28 #include "rgb2rgb.h" |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
29 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
30 #define SIZE 1000 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
31 #define srcByte 0x55 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
32 #define dstByte 0xBB |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
33 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
34 #define FUNC(s,d,n) {s,d,#n,n} |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
35 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
36 static int cpu_caps; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
37 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
38 static char *args_parse(int argc, char *argv[]) |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
39 { |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
40 int o; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
41 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
42 while ((o = getopt(argc, argv, "m23")) != -1) { |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
43 switch (o) { |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
44 case 'm': |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
45 cpu_caps |= SWS_CPU_CAPS_MMX; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
46 break; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
47 case '2': |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
48 cpu_caps |= SWS_CPU_CAPS_MMX2; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
49 break; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
50 case '3': |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
51 cpu_caps |= SWS_CPU_CAPS_3DNOW; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
52 break; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
53 default: |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
54 av_log(NULL, AV_LOG_ERROR, "Unknown option %c\n", o); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
55 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
56 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
57 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
58 return argv[optind]; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
59 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
60 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
61 int main(int argc, char **argv) |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
62 { |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
63 int i, funcNum; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
64 uint8_t *srcBuffer= (uint8_t*)av_malloc(SIZE); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
65 uint8_t *dstBuffer= (uint8_t*)av_malloc(SIZE); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
66 int failedNum=0; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
67 int passedNum=0; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
68 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
69 av_log(NULL, AV_LOG_INFO, "memory corruption test ...\n"); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
70 args_parse(argc, argv); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
71 av_log(NULL, AV_LOG_INFO, "CPU capabilities forced to %x\n", cpu_caps); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
72 sws_rgb2rgb_init(cpu_caps); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
73 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
74 for(funcNum=0; ; funcNum++){ |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
75 struct func_info_s { |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
76 int src_bpp; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
77 int dst_bpp; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
78 const char *name; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
79 void (*func)(const uint8_t *src, uint8_t *dst, long src_size); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
80 } func_info[] = { |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
81 FUNC(2, 2, rgb15to16), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
82 FUNC(2, 3, rgb15to24), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
83 FUNC(2, 4, rgb15to32), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
84 FUNC(2, 3, rgb16to24), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
85 FUNC(2, 4, rgb16to32), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
86 FUNC(3, 2, rgb24to15), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
87 FUNC(3, 2, rgb24to16), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
88 FUNC(3, 4, rgb24to32), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
89 FUNC(4, 2, rgb32to15), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
90 FUNC(4, 2, rgb32to16), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
91 FUNC(4, 3, rgb32to24), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
92 FUNC(2, 2, rgb16to15), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
93 FUNC(2, 2, rgb15tobgr15), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
94 FUNC(2, 2, rgb15tobgr16), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
95 FUNC(2, 3, rgb15tobgr24), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
96 FUNC(2, 4, rgb15tobgr32), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
97 FUNC(2, 2, rgb16tobgr15), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
98 FUNC(2, 2, rgb16tobgr16), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
99 FUNC(2, 3, rgb16tobgr24), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
100 FUNC(2, 4, rgb16tobgr32), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
101 FUNC(3, 2, rgb24tobgr15), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
102 FUNC(3, 2, rgb24tobgr16), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
103 FUNC(3, 3, rgb24tobgr24), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
104 FUNC(3, 4, rgb24tobgr32), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
105 FUNC(4, 2, rgb32tobgr15), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
106 FUNC(4, 2, rgb32tobgr16), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
107 FUNC(4, 3, rgb32tobgr24), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
108 FUNC(4, 4, rgb32tobgr32), |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
109 FUNC(0, 0, NULL) |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
110 }; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
111 int width; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
112 int failed=0; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
113 int srcBpp=0; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
114 int dstBpp=0; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
115 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
116 if (!func_info[funcNum].func) break; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
117 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
118 av_log(NULL, AV_LOG_INFO,"."); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
119 memset(srcBuffer, srcByte, SIZE); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
120 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
121 for(width=63; width>0; width--){ |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
122 int dstOffset; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
123 for(dstOffset=128; dstOffset<196; dstOffset+=4){ |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
124 int srcOffset; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
125 memset(dstBuffer, dstByte, SIZE); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
126 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
127 for(srcOffset=128; srcOffset<196; srcOffset+=4){ |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
128 uint8_t *src= srcBuffer+srcOffset; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
129 uint8_t *dst= dstBuffer+dstOffset; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
130 const char *name=NULL; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
131 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
132 if(failed) break; //don't fill the screen with shit ... |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
133 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
134 srcBpp = func_info[funcNum].src_bpp; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
135 dstBpp = func_info[funcNum].dst_bpp; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
136 name = func_info[funcNum].name; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
137 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
138 func_info[funcNum].func(src, dst, width*srcBpp); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
139 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
140 if(!srcBpp) break; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
141 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
142 for(i=0; i<SIZE; i++){ |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
143 if(srcBuffer[i]!=srcByte){ |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
144 av_log(NULL, AV_LOG_INFO, "src damaged at %d w:%d src:%d dst:%d %s\n", |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
145 i, width, srcOffset, dstOffset, name); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
146 failed=1; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
147 break; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
148 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
149 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
150 for(i=0; i<dstOffset; i++){ |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
151 if(dstBuffer[i]!=dstByte){ |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
152 av_log(NULL, AV_LOG_INFO, "dst damaged at %d w:%d src:%d dst:%d %s\n", |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
153 i, width, srcOffset, dstOffset, name); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
154 failed=1; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
155 break; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
156 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
157 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
158 for(i=dstOffset + width*dstBpp; i<SIZE; i++){ |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
159 if(dstBuffer[i]!=dstByte){ |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
160 av_log(NULL, AV_LOG_INFO, "dst damaged at %d w:%d src:%d dst:%d %s\n", |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
161 i, width, srcOffset, dstOffset, name); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
162 failed=1; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
163 break; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
164 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
165 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
166 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
167 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
168 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
169 if(failed) failedNum++; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
170 else if(srcBpp) passedNum++; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
171 } |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
172 |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
173 av_log(NULL, AV_LOG_INFO, "\n%d converters passed, %d converters randomly overwrote memory\n", passedNum, failedNum); |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
174 return failedNum; |
15e1d6124a6b
Rename cs_test.c --> colorspace-test.c. This is more consistent with the names
diego
parents:
diff
changeset
|
175 } |