Changeset 748 for soft/giet_vm/applications/mjpeg/mjpeg.c
- Timestamp:
- Dec 16, 2015, 1:03:16 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/mjpeg/mjpeg.c
r741 r748 31 31 32 32 // macro to use a shared TTY 33 #define PRINTF(...) lock_acquire( &tty_lock ); \34 giet_tty_printf(__VA_ARGS__); \35 lock_release( &tty_lock);33 #define PRINTF(...) do { lock_acquire( &tty_lock ); \ 34 giet_tty_printf(__VA_ARGS__); \ 35 lock_release( &tty_lock ); } while(0); 36 36 37 37 /////////////////////////////////////////////// … … 125 125 if ( INTERACTIVE_MODE ) 126 126 { 127 PRINTF("\n[MJPEG] enter path for JPEG stream file (default is plan_48.mjpg)\n> ") 127 PRINTF("\n[MJPEG] enter path for JPEG stream file (default is plan_48.mjpg)\n> "); 128 128 giet_tty_gets( file_pathname , 256 ); 129 129 … … 136 136 else 137 137 { 138 PRINTF("\n[MJPEG] enter image width\n> ") 138 PRINTF("\n[MJPEG] enter image width\n> "); 139 139 giet_tty_getw( &image_width ); 140 PRINTF("\n[MJPEG] enter image height\n> ") 140 PRINTF("\n[MJPEG] enter image height\n> "); 141 141 giet_tty_getw( &image_height ); 142 PRINTF("\n") 142 PRINTF("\n"); 143 143 } 144 144 } … … 154 154 155 155 if ( USE_DCT_COPROC ) 156 { PRINTF("\n\n[MJPEG] stream %s / %d clusters / %d cores / DCT COPROC\n\n", 157 file_pathname , x_size*y_size , nprocs ) } 156 { 157 PRINTF("\n\n[MJPEG] stream %s / %d clusters / %d cores / DCT COPROC\n\n", 158 file_pathname , x_size*y_size , nprocs ); 159 } 158 160 else 159 { PRINTF("\n\n[MJPEG] stream %s / %d clusters / %d cores / NO DCT COPROC\n\n", 160 file_pathname , x_size*y_size , nprocs ) } 161 { 162 PRINTF("\n\n[MJPEG] stream %s / %d clusters / %d cores / NO DCT COPROC\n\n", 163 file_pathname , x_size*y_size , nprocs ); 164 } 161 165 162 166 // compute nblocks_h & nblocks_w … … 234 238 pc = main_2_demux[n]; 235 239 PRINTF(" - main_2_demux[%d] = %x / &lock = %x / &buf = %x / size = %d\n", 236 n, pc, (uint32_t)&pc->lock, (uint32_t)pc->data, pc->depth<<2 ) 240 n, pc, (uint32_t)&pc->lock, (uint32_t)pc->data, pc->depth<<2 ); 237 241 238 242 pc = demux_2_vld_data[n]; 239 243 PRINTF(" - demux_2_vld[%d] = %x / &lock = %x / &buf = %x / size = %d\n", 240 n, pc, (uint32_t)&pc->lock, (uint32_t)pc->data, pc->depth<<2 ) 244 n, pc, (uint32_t)&pc->lock, (uint32_t)pc->data, pc->depth<<2 ); 241 245 242 246 pc = vld_2_iqzz[n]; 243 247 PRINTF(" - vld_2_iqzz[%d] = %x / &lock = %x / &buf = %x / size = %d\n", 244 n, pc, (uint32_t)&pc->lock, (uint32_t)pc->data, pc->depth<<2 ) 248 n, pc, (uint32_t)&pc->lock, (uint32_t)pc->data, pc->depth<<2 ); 245 249 246 250 pc = iqzz_2_idct[n]; 247 251 PRINTF(" - iqzz_2_idct[%d] = %x / &lock = %x / &buf = %x / size = %d\n", 248 n, pc, (uint32_t)&pc->lock, (uint32_t)pc->data, pc->depth<<2 ) 252 n, pc, (uint32_t)&pc->lock, (uint32_t)pc->data, pc->depth<<2 ); 249 253 250 254 pc = idct_2_libu[n]; 251 255 PRINTF(" - idct_2_libu[%d] = %x / &lock = %x / &buf = %x / size = %d\n", 252 n, pc, (uint32_t)&pc->lock, (uint32_t)pc->data, pc->depth<<2 ) 256 n, pc, (uint32_t)&pc->lock, (uint32_t)pc->data, pc->depth<<2 ); 253 257 } 254 258 … … 407 411 #if DEBUG_MAIN 408 412 PRINTF("\nMAIN send image %d to cluster %d at cycle %d : %d bytes\n", 409 image , cluster , giet_proctime() , bytes_count ) 413 image , cluster , giet_proctime() , bytes_count ); 410 414 #endif 411 415 // increment image index … … 429 433 430 434 if ( giet_pthread_join( trdid_demux[index] , NULL ) ) 431 { PRINTF("\n[MJPEG ERROR] calling giet_pthread_join() for demux[%d]\n", index ) }435 PRINTF("\n[MJPEG ERROR] calling giet_pthread_join() for demux[%d]\n", index ); 432 436 433 437 if ( giet_pthread_join( trdid_vld[index] , NULL ) ) 434 { PRINTF("\n[MJPEG ERROR] calling giet_pthread_join() for vld[%d]\n", index ) }438 PRINTF("\n[MJPEG ERROR] calling giet_pthread_join() for vld[%d]\n", index ); 435 439 436 440 if ( giet_pthread_join( trdid_iqzz[index] , NULL ) ) 437 { PRINTF("\n[MJPEG ERROR] calling giet_pthread_join() for iqzz[%d]\n", index ) }441 PRINTF("\n[MJPEG ERROR] calling giet_pthread_join() for iqzz[%d]\n", index ); 438 442 439 443 if ( USE_DCT_COPROC == 0 ) 440 444 { 441 445 if ( giet_pthread_join( trdid_idct[index] , NULL ) ) 442 { PRINTF("\n[MJPEG ERROR] calling giet_pthread_join() for idct[%d]\n", index ) }446 PRINTF("\n[MJPEG ERROR] calling giet_pthread_join() for idct[%d]\n", index ); 443 447 } 444 448 445 449 if ( giet_pthread_join( trdid_libu[index] , NULL ) ) 446 { PRINTF("\n[MJPEG ERROR] calling giet_pthread_join() for libu[%d]\n", index ) }450 PRINTF("\n[MJPEG ERROR] calling giet_pthread_join() for libu[%d]\n", index ); 447 451 448 452 if ( USE_DCT_COPROC ) … … 459 463 ///////////////////////////////////////////////////////////////////////////////////// 460 464 461 PRINTF("\n[MJPEG] Instumentation Results\n" ) 465 // display on TTY 466 PRINTF("\n[MJPEG] Instumentation Results\n" ); 462 467 for ( image = 0 ; image < MAX_IMAGES ; image++ ) 463 { PRINTF(" - Image %d : completed at cycle %d\n", image , date[image]) } 464 468 PRINTF(" - Image %d : completed at cycle %d\n", image , date[image]); 469 470 // save on disk 471 unsigned int fdout = giet_fat_open( "/home/mjpeg_instrumentation" , O_CREATE ); 472 if ( fdout < 0 ) 473 PRINTF("\n[MJPEG ERROR] cannot open file /home/mjpeg_instrumentation\n"); 474 475 int ret = giet_fat_lseek( fdout, 0 , SEEK_END ); 476 if( ret < 0 ) 477 PRINTF("\n[MJPEG ERROR] cannot seek file /home/mjpeg_instrumentation\n"); 478 479 if( USE_DCT_COPROC ) 480 { 481 giet_fat_fprintf( fdout, "\n*** stream %s / %d clusters / %d cores / DCT COPROC\n", 482 file_pathname , x_size*y_size , nprocs ); 483 } 484 else 485 { 486 giet_fat_fprintf( fdout, "stream %s / %d clusters / %d cores / NO DCT COPROC\n\n", 487 file_pathname , x_size*y_size , nprocs ); 488 } 489 for ( image = 0 ; image < MAX_IMAGES ; image++ ) 490 { 491 giet_fat_fprintf( fdout, " - Image %d : completed at cycle %d\n", 492 image , date[image]); 493 } 494 495 // completed 465 496 giet_pthread_exit( "main completed" ); 466 497
Note: See TracChangeset
for help on using the changeset viewer.