comparison TOOLS/realcodecs/drv2.c @ 25313:9e13376e0daa

Fix printf format string length modifiers, removes about a trillion warnings.
author diego
date Mon, 10 Dec 2007 14:39:19 +0000
parents 2d5cf446b8d7
children 105de0884218
comparison
equal deleted inserted replaced
25312:643c5e2b6b56 25313:9e13376e0daa
136 usecs=tv2.tv_usec-tv1.tv_usec; 136 usecs=tv2.tv_usec-tv1.tv_usec;
137 if (usecs<0) { 137 if (usecs<0) {
138 usecs+=1000000; 138 usecs+=1000000;
139 --secs; 139 --secs;
140 } 140 }
141 // fprintf(stderr, "Duration: %d.%0.6ds\n", secs, usecs); 141 // fprintf(stderr, "Duration: %ld.%0.6lds\n", secs, usecs);
142 } 142 }
143 143
144 144
145 static void hexdump(void *pos, int len) { 145 static void hexdump(void *pos, int len) {
146 unsigned char *cpos=pos, *cpos1; 146 unsigned char *cpos=pos, *cpos1;
175 175
176 ulong RV20toYUV420CustomMessage(ulong* p1,ulong p2) { 176 ulong RV20toYUV420CustomMessage(ulong* p1,ulong p2) {
177 ulong result; 177 ulong result;
178 // ulong *pp1=p1; 178 // ulong *pp1=p1;
179 ulong temp[16]; 179 ulong temp[16];
180 fprintf(stderr, "#R# => RV20toYUV420CustomMessage(%p,%p) [%d,%d,%d] \n", p1, p2, p1[0],p1[1],p1[2]); 180 fprintf(stderr, "#R# => RV20toYUV420CustomMessage(%p,%p) [%ld,%ld,%ld] \n", p1, p2, p1[0],p1[1],p1[2]);
181 181
182 /* 182 /*
183 if(p1[0]!=17) return 0; 183 if(p1[0]!=17) return 0;
184 184
185 if(p1[1]!=1) return 0; 185 if(p1[1]!=1) return 0;
207 case 3: 207 case 3:
208 default: 208 default:
209 return 0; 209 return 0;
210 } 210 }
211 } 211 }
212 // fprintf(stderr, "ulong p2=0x%0x(%d))\n", p2, p2); 212 // fprintf(stderr, "ulong p2=0x%0lx(%ld))\n", p2, p2);
213 // hexdump((void*)p1, 12); 213 // hexdump((void*)p1, 12);
214 // if (pp1[0]==0x24) { 214 // if (pp1[0]==0x24) {
215 // hexdump((void*)(pp1[2]),128); 215 // hexdump((void*)(pp1[2]),128);
216 // } 216 // }
217 // tic(); 217 // tic();
218 result=(*rvyuvCustomMessage)(p1,p2); 218 result=(*rvyuvCustomMessage)(p1,p2);
219 // toc(); 219 // toc();
220 fprintf(stderr, "#R# <= RV20toYUV420CustomMessage --> 0x%0x(%d)\n", result, result); 220 fprintf(stderr, "#R# <= RV20toYUV420CustomMessage --> 0x%0lx(%ld)\n", result, result);
221 return result; 221 return result;
222 } 222 }
223 223
224 ulong RV20toYUV420Free(ulong p1) { 224 ulong RV20toYUV420Free(ulong p1) {
225 ulong result; 225 ulong result;
226 fprintf(stderr, "RV20toYUV420Free(ulong p1=0x%0x(%d))\n", p1, p1); 226 fprintf(stderr, "RV20toYUV420Free(ulong p1=0x%0lx(%ld))\n", p1, p1);
227 // hexdump((void*)p1, 44); 227 // hexdump((void*)p1, 44);
228 tic(); 228 tic();
229 result=(*rvyuvFree)(p1); 229 result=(*rvyuvFree)(p1);
230 toc(); 230 toc();
231 // hexdump((void*)p1, 44); 231 // hexdump((void*)p1, 44);
232 fprintf(stderr, "RV20toYUV420Free --> 0x%0x(%d)\n\n\n", result, result); 232 fprintf(stderr, "RV20toYUV420Free --> 0x%0lx(%ld)\n\n\n", result, result);
233 return result; 233 return result;
234 } 234 }
235 235
236 char h_temp[32768]; 236 char h_temp[32768];
237 237
238 ulong RV20toYUV420HiveMessage(ulong *p1,ulong p2) { 238 ulong RV20toYUV420HiveMessage(ulong *p1,ulong p2) {
239 ulong result; 239 ulong result;
240 fprintf(stderr, "#R# RV20toYUV420HiveMessage(%p,%p)\n", p1, p2); 240 fprintf(stderr, "#R# RV20toYUV420HiveMessage(%p,%p)\n", p1, p2);
241 // p1->constant,p1->width,p1->height,p1->format1,p1->format2); 241 // p1->constant,p1->width,p1->height,p1->format1,p1->format2);
242 // fprintf(stderr, "ulong p2=0x%0x(%d))\n", p2, p2); 242 // fprintf(stderr, "ulong p2=0x%0lx(%ld))\n", p2, p2);
243 // hexdump((void*)p1, sizeof(struct init_data)); 243 // hexdump((void*)p1, sizeof(struct init_data));
244 244
245 fprintf(stderr,">HIVE %d %p\n",p1[0],p1[1]); 245 fprintf(stderr,">HIVE %ld %p\n",p1[0],p1[1]);
246 246
247 if(p1[0]!=0) return 0; 247 if(p1[0]!=0) return 0;
248 248
249 p1[1]=0x10000000; 249 p1[1]=0x10000000;
250 return 0; 250 return 0;
266 memset(h_temp,0x77,1000); 266 memset(h_temp,0x77,1000);
267 267
268 // p1[0]=0; 268 // p1[0]=0;
269 // p1[1]=0x20000000; 269 // p1[1]=0x20000000;
270 270
271 fprintf(stderr,"<HIVE %d %p\n",p1[0],p1[1]); 271 fprintf(stderr,"<HIVE %ld %p\n",p1[0],p1[1]);
272 272
273 // hexdump((void*)p1, sizeof(struct init_data)); 273 // hexdump((void*)p1, sizeof(struct init_data));
274 // hexdump((void*)p1, 8); 274 // hexdump((void*)p1, 8);
275 fprintf(stderr, "#R# RV20toYUV420HiveMessage --> 0x%0x(%d)\n\n", result, result); 275 fprintf(stderr, "#R# RV20toYUV420HiveMessage --> 0x%0lx(%ld)\n\n", result, result);
276 return result; 276 return result;
277 } 277 }
278 278
279 struct init_data { 279 struct init_data {
280 short constant; //=0xb; 280 short constant; //=0xb;
289 289
290 static char i_temp[32768]; 290 static char i_temp[32768];
291 291
292 ulong RV20toYUV420Init(ulong p1,ulong p2) { 292 ulong RV20toYUV420Init(ulong p1,ulong p2) {
293 ulong result; 293 ulong result;
294 fprintf(stderr, "#R# RV20toYUV420Init(ulong p1=0x%0x(%d), ", p1, p1); 294 fprintf(stderr, "#R# RV20toYUV420Init(ulong p1=0x%0lx(%ld), ", p1, p1);
295 fprintf(stderr, "ulong p2=0x%0x(%d))\n", p2, p2); 295 fprintf(stderr, "ulong p2=0x%0lx(%ld))\n", p2, p2);
296 296
297 fprintf(stderr,"COPY INIT DATA!\n"); 297 fprintf(stderr,"COPY INIT DATA!\n");
298 memcpy(i_temp,p1,24); 298 memcpy(i_temp,p1,24);
299 p1=i_temp; 299 p1=i_temp;
300 fprintf(stderr,"COPY OK!\n"); 300 fprintf(stderr,"COPY OK!\n");
306 hexdump((void*)p1, 24); 306 hexdump((void*)p1, 24);
307 307
308 memset(i_temp,0x77,1000); 308 memset(i_temp,0x77,1000);
309 309
310 // hexdump(*((void**)p2), 512); 310 // hexdump(*((void**)p2), 512);
311 fprintf(stderr, "#R# RV20toYUV420Init --> 0x%0x(%d)\n\n\n", result, result); 311 fprintf(stderr, "#R# RV20toYUV420Init --> 0x%0lx(%ld)\n\n\n", result, result);
312 return result; 312 return result;
313 } 313 }
314 314
315 unsigned long build_crc(unsigned char *pch, unsigned long len) { 315 unsigned long build_crc(unsigned char *pch, unsigned long len) {
316 unsigned long crc=0, a; 316 unsigned long crc=0, a;
372 // it's not the real crc function, but so what... 372 // it's not the real crc function, but so what...
373 pch=p1; 373 pch=p1;
374 crc_src=build_crc(pch, pp3[0]); 374 crc_src=build_crc(pch, pp3[0]);
375 375
376 pp4=pp3[3]; 376 pp4=pp3[3];
377 fprintf(stderr,"transin1[%p]: {%d/%d} ",pp4,pp3[2],pp3[0]); 377 fprintf(stderr,"transin1[%p]: {%ld/%ld} ",pp4,pp3[2],pp3[0]);
378 // pp4[0],pp4[1],pp4[2],pp4[3], 378 // pp4[0],pp4[1],pp4[2],pp4[3],
379 // pp4[4],pp4[5],pp4[6],pp4[7]); 379 // pp4[4],pp4[5],pp4[6],pp4[7]);
380 380
381 memset(temp,0x77,128*4); 381 memset(temp,0x77,128*4);
382 382
383 memcpy(temp,pp4,8*(pp3[2]+1)); 383 memcpy(temp,pp4,8*(pp3[2]+1));
384 for(i=0;i<=pp3[2];i++){ 384 for(i=0;i<=pp3[2];i++){
385 fprintf(stderr," %p(%d)",temp[i*2],temp[i*2+1]); 385 fprintf(stderr," %p(%ld)",temp[i*2],temp[i*2+1]);
386 } 386 }
387 fprintf(stderr,"\n"); 387 fprintf(stderr,"\n");
388 388
389 389
390 pp3[3]=pp4=temp; 390 pp3[3]=pp4=temp;
426 // crc1=build_crc(p2+pp4[3]*pp4[4]/2, pp4[3]*pp4[4]/2); 426 // crc1=build_crc(p2+pp4[3]*pp4[4]/2, pp4[3]*pp4[4]/2);
427 // crc2=build_crc(p2+pp4[3]*pp4[4], pp4[3]*pp4[4]/2); 427 // crc2=build_crc(p2+pp4[3]*pp4[4], pp4[3]*pp4[4]/2);
428 428
429 // pp3=p3; 429 // pp3=p3;
430 // TRANSFORM: <timestamp> <numblocks> <len> <crc_src> <crc_dest> <p4[4]> 430 // TRANSFORM: <timestamp> <numblocks> <len> <crc_src> <crc_dest> <p4[4]>
431 // fprintf(stderr, "TRAFO:\t%d\t%d\t%d\t%.8X\t%.8X\t%d\n", 431 // fprintf(stderr, "TRAFO:\t%ld\t%ld\t%ld\t%.8lX\t%.8lX\t%ld\n",
432 // pp3[5], pp3[2], pp3[0], crc_src, crc0, pp3[4]); 432 // pp3[5], pp3[2], pp3[0], crc_src, crc0, pp3[4]);
433 fprintf(stderr, "#R# Decode: %d(%d) [%08X] pts=%d -> %d [%08X]\n", 433 fprintf(stderr, "#R# Decode: %ld(%ld) [%08lX] pts=%ld -> %ld [%08lX]\n",
434 pp3[0],pp3[2],crc_src,pp3[5], 434 pp3[0],pp3[2],crc_src,pp3[5],
435 result,crc0); 435 result,crc0);
436 436
437 // output 437 // output
438 // hexdump((char*)p2, /*64*/ pp4[3]*pp4[4]/2); 438 // hexdump((char*)p2, /*64*/ pp4[3]*pp4[4]/2);
439 // hexdump((void*)p4, 20); 439 // hexdump((void*)p4, 20);
440 // hexdump((void*)p5, 512); 440 // hexdump((void*)p5, 512);
441 // fprintf(stderr, "RV20toYUV420Transform --> 0x%0x(%d)\n\n\n", result, result); 441 // fprintf(stderr, "RV20toYUV420Transform --> 0x%0lx(%ld)\n\n\n", result, result);
442 return result; 442 return result;
443 } 443 }
444 444
445 ulong RV20toYUV420_RN_FRU_Free(ulong p1) { 445 ulong RV20toYUV420_RN_FRU_Free(ulong p1) {
446 ulong result; 446 ulong result;
447 fprintf(stderr, "RV20toYUV420_RN_FRU_Free(ulong p1=0x%0x(%d))\n", p1, p1); 447 fprintf(stderr, "RV20toYUV420_RN_FRU_Free(ulong p1=0x%0lx(%ld))\n", p1, p1);
448 tic(); 448 tic();
449 result=(*rvyuvRNFRUFree)(p1); 449 result=(*rvyuvRNFRUFree)(p1);
450 toc(); 450 toc();
451 fprintf(stderr, "RV20toYUV420_RN_FRU_Free --> 0x%0x(%d)\n\n\n", result, result); 451 fprintf(stderr, "RV20toYUV420_RN_FRU_Free --> 0x%0lx(%ld)\n\n\n", result, result);
452 return result; 452 return result;
453 } 453 }
454 454
455 ulong RV20toYUV420_RN_FRU_GetFrame(ulong p1,ulong p2,ulong p3) { 455 ulong RV20toYUV420_RN_FRU_GetFrame(ulong p1,ulong p2,ulong p3) {
456 ulong result; 456 ulong result;
457 // fprintf(stderr, "RV20toYUV420_RN_FRU_GetFrame(ulong p1=0x%0x(%d), ", p1, p1); 457 // fprintf(stderr, "RV20toYUV420_RN_FRU_GetFrame(ulong p1=0x%0lx(%ld), ", p1, p1);
458 // fprintf(stderr, "ulong p2=0x%0x(%d),\n\t", p2, p2); 458 // fprintf(stderr, "ulong p2=0x%0lx(%ld),\n\t", p2, p2);
459 // fprintf(stderr, "ulong p3=0x%0x(%d))\n", p3, p3); 459 // fprintf(stderr, "ulong p3=0x%0lx(%ld))\n", p3, p3);
460 // hexdump((void*)p1, 44); 460 // hexdump((void*)p1, 44);
461 tic(); 461 tic();
462 result=(*rvyuvRNFRUGetFrame)(p1,p2,p3); 462 result=(*rvyuvRNFRUGetFrame)(p1,p2,p3);
463 toc(); 463 toc();
464 // hexdump((void*)p1, 44); 464 // hexdump((void*)p1, 44);
465 // fprintf(stderr, "RV20toYUV420_RN_FRU_GetFrame --> 0x%0x(%d)\n\n\n", result, result); 465 // fprintf(stderr, "RV20toYUV420_RN_FRU_GetFrame --> 0x%0lx(%ld)\n\n\n", result, result);
466 return result; 466 return result;
467 } 467 }
468 468
469 ulong RV20toYUV420_RN_FRU_Init(ulong p1,ulong p2,ulong p3) { 469 ulong RV20toYUV420_RN_FRU_Init(ulong p1,ulong p2,ulong p3) {
470 ulong result; 470 ulong result;
471 // fprintf(stderr, "RV20toYUV420_RN_FRU_Init(ulong p1=0x%0x(%d), ", p1, p1); 471 // fprintf(stderr, "RV20toYUV420_RN_FRU_Init(ulong p1=0x%0lx(%ld), ", p1, p1);
472 // fprintf(stderr, "ulong p2=0x%0x(%d),\n\t", p2, p2); 472 // fprintf(stderr, "ulong p2=0x%0lx(%ld),\n\t", p2, p2);
473 // fprintf(stderr, "ulong p3=0x%0x(%d))\n", p3, p3); 473 // fprintf(stderr, "ulong p3=0x%0lx(%ld))\n", p3, p3);
474 // hexdump((void*)p1, 44); 474 // hexdump((void*)p1, 44);
475 tic(); 475 tic();
476 result=(*rvyuvRNFRUInit)(p1,p2,p3); 476 result=(*rvyuvRNFRUInit)(p1,p2,p3);
477 toc(); 477 toc();
478 // hexdump((void*)p1, 44); 478 // hexdump((void*)p1, 44);
479 // fprintf(stderr, "RV20toYUV420_RN_FRU_Init --> 0x%0x(%d)\n\n\n", result, result); 479 // fprintf(stderr, "RV20toYUV420_RN_FRU_Init --> 0x%0lx(%ld)\n\n\n", result, result);
480 return result; 480 return result;
481 } 481 }
482 482
483 ulong RV20toYUV420_RN_FRU_Setup(ulong p1,ulong p2,ulong p3,ulong p4, 483 ulong RV20toYUV420_RN_FRU_Setup(ulong p1,ulong p2,ulong p3,ulong p4,
484 ulong p5,ulong p6,ulong p7,ulong p8) { 484 ulong p5,ulong p6,ulong p7,ulong p8) {
485 ulong result; 485 ulong result;
486 // fprintf(stderr, "RV20toYUV420_RN_FRU_Setup(ulong p1=0x%0x(%d), ", p1, p1); 486 // fprintf(stderr, "RV20toYUV420_RN_FRU_Setup(ulong p1=0x%0lx(%ld), ", p1, p1);
487 // fprintf(stderr, "ulong p2=0x%0x(%d),\n\t", p2, p2); 487 // fprintf(stderr, "ulong p2=0x%0lx(%ld),\n\t", p2, p2);
488 // fprintf(stderr, "ulong p3=0x%0x(%d), ", p3, p3); 488 // fprintf(stderr, "ulong p3=0x%0lx(%ld), ", p3, p3);
489 // fprintf(stderr, "ulong p4=0x%0x(%d),\n\t", p4, p4); 489 // fprintf(stderr, "ulong p4=0x%0lx(%ld),\n\t", p4, p4);
490 // fprintf(stderr, "ulong p5=0x%0x(%d), ", p5, p5); 490 // fprintf(stderr, "ulong p5=0x%0lx(%ld), ", p5, p5);
491 // fprintf(stderr, "ulong p6=0x%0x(%d),\n\t", p6, p6); 491 // fprintf(stderr, "ulong p6=0x%0lx(%ld),\n\t", p6, p6);
492 // fprintf(stderr, "ulong p7=0x%0x(%d), ", p7, p7); 492 // fprintf(stderr, "ulong p7=0x%0lx(%ld), ", p7, p7);
493 // fprintf(stderr, "ulong p8=0x%0x(%d))\n", p8, p8); 493 // fprintf(stderr, "ulong p8=0x%0lx(%ld))\n", p8, p8);
494 // hexdump((void*)p1, 44); 494 // hexdump((void*)p1, 44);
495 tic(); 495 tic();
496 result=(*rvyuvRNFRUSetup)(p1,p2,p3,p4,p5,p6,p7,p8); 496 result=(*rvyuvRNFRUSetup)(p1,p2,p3,p4,p5,p6,p7,p8);
497 toc(); 497 toc();
498 // hexdump((void*)p1, 44); 498 // hexdump((void*)p1, 44);
499 // fprintf(stderr, "RV20toYUV420_RN_FRU_Setup --> 0x%0x(%d)\n\n\n", result, result); 499 // fprintf(stderr, "RV20toYUV420_RN_FRU_Setup --> 0x%0lx(%ld)\n\n\n", result, result);
500 return result; 500 return result;
501 } 501 }
502 502
503 /*void SetDLLAccessPath(ulong p1) { 503 /*void SetDLLAccessPath(ulong p1) {
504 fprintf(stderr, "SetDLLAccessPath(ulong p1=0x%0x(%d))\n", p1, p1); 504 fprintf(stderr, "SetDLLAccessPath(ulong p1=0x%0lx(%ld))\n", p1, p1);
505 hexdump((void*)p1, 44); 505 hexdump((void*)p1, 44);
506 (*setDLLAccessPath)(p1); 506 (*setDLLAccessPath)(p1);
507 hexdump((void*)p1, 44); 507 hexdump((void*)p1, 44);
508 fprintf(stderr, "--> void\n\n\n"); 508 fprintf(stderr, "--> void\n\n\n");
509 } 509 }