comparison libswscale/colorspace-test.c @ 29481:c080f1f5c07e

Cosmetics: - Place curly brackets in the same line as while/for/if/switch/else/do; - Place curly brackets at column 0 in the next line starting a function.
author ramiro
date Sun, 16 Aug 2009 21:11:28 +0000
parents a4d8dee13834
children 3e7ffd70b12b
comparison
equal deleted inserted replaced
29480:a4d8dee13834 29481:c080f1f5c07e
69 av_log(NULL, AV_LOG_INFO, "memory corruption test ...\n"); 69 av_log(NULL, AV_LOG_INFO, "memory corruption test ...\n");
70 args_parse(argc, argv); 70 args_parse(argc, argv);
71 av_log(NULL, AV_LOG_INFO, "CPU capabilities forced to %x\n", cpu_caps); 71 av_log(NULL, AV_LOG_INFO, "CPU capabilities forced to %x\n", cpu_caps);
72 sws_rgb2rgb_init(cpu_caps); 72 sws_rgb2rgb_init(cpu_caps);
73 73
74 for(funcNum=0; ; funcNum++){ 74 for(funcNum=0; ; funcNum++) {
75 struct func_info_s { 75 struct func_info_s {
76 int src_bpp; 76 int src_bpp;
77 int dst_bpp; 77 int dst_bpp;
78 const char *name; 78 const char *name;
79 void (*func)(const uint8_t *src, uint8_t *dst, long src_size); 79 void (*func)(const uint8_t *src, uint8_t *dst, long src_size);
116 if (!func_info[funcNum].func) break; 116 if (!func_info[funcNum].func) break;
117 117
118 av_log(NULL, AV_LOG_INFO,"."); 118 av_log(NULL, AV_LOG_INFO,".");
119 memset(srcBuffer, srcByte, SIZE); 119 memset(srcBuffer, srcByte, SIZE);
120 120
121 for(width=63; width>0; width--){ 121 for(width=63; width>0; width--) {
122 int dstOffset; 122 int dstOffset;
123 for(dstOffset=128; dstOffset<196; dstOffset+=4){ 123 for(dstOffset=128; dstOffset<196; dstOffset+=4) {
124 int srcOffset; 124 int srcOffset;
125 memset(dstBuffer, dstByte, SIZE); 125 memset(dstBuffer, dstByte, SIZE);
126 126
127 for(srcOffset=128; srcOffset<196; srcOffset+=4){ 127 for(srcOffset=128; srcOffset<196; srcOffset+=4) {
128 uint8_t *src= srcBuffer+srcOffset; 128 uint8_t *src= srcBuffer+srcOffset;
129 uint8_t *dst= dstBuffer+dstOffset; 129 uint8_t *dst= dstBuffer+dstOffset;
130 const char *name=NULL; 130 const char *name=NULL;
131 131
132 if(failed) break; //don't fill the screen with shit ... 132 if(failed) break; //don't fill the screen with shit ...
137 137
138 func_info[funcNum].func(src, dst, width*srcBpp); 138 func_info[funcNum].func(src, dst, width*srcBpp);
139 139
140 if(!srcBpp) break; 140 if(!srcBpp) break;
141 141
142 for(i=0; i<SIZE; i++){ 142 for(i=0; i<SIZE; i++) {
143 if(srcBuffer[i]!=srcByte){ 143 if(srcBuffer[i]!=srcByte) {
144 av_log(NULL, AV_LOG_INFO, "src damaged at %d w:%d src:%d dst:%d %s\n", 144 av_log(NULL, AV_LOG_INFO, "src damaged at %d w:%d src:%d dst:%d %s\n",
145 i, width, srcOffset, dstOffset, name); 145 i, width, srcOffset, dstOffset, name);
146 failed=1; 146 failed=1;
147 break; 147 break;
148 } 148 }
149 } 149 }
150 for(i=0; i<dstOffset; i++){ 150 for(i=0; i<dstOffset; i++) {
151 if(dstBuffer[i]!=dstByte){ 151 if(dstBuffer[i]!=dstByte) {
152 av_log(NULL, AV_LOG_INFO, "dst damaged at %d w:%d src:%d dst:%d %s\n", 152 av_log(NULL, AV_LOG_INFO, "dst damaged at %d w:%d src:%d dst:%d %s\n",
153 i, width, srcOffset, dstOffset, name); 153 i, width, srcOffset, dstOffset, name);
154 failed=1; 154 failed=1;
155 break; 155 break;
156 } 156 }
157 } 157 }
158 for(i=dstOffset + width*dstBpp; i<SIZE; i++){ 158 for(i=dstOffset + width*dstBpp; i<SIZE; i++) {
159 if(dstBuffer[i]!=dstByte){ 159 if(dstBuffer[i]!=dstByte) {
160 av_log(NULL, AV_LOG_INFO, "dst damaged at %d w:%d src:%d dst:%d %s\n", 160 av_log(NULL, AV_LOG_INFO, "dst damaged at %d w:%d src:%d dst:%d %s\n",
161 i, width, srcOffset, dstOffset, name); 161 i, width, srcOffset, dstOffset, name);
162 failed=1; 162 failed=1;
163 break; 163 break;
164 } 164 }