Changeset 748 for soft/giet_vm/applications/mjpeg/vld.c
- Timestamp:
- Dec 16, 2015, 1:03:16 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/mjpeg/vld.c
r736 r748 23 23 24 24 // macro to use a shared TTY 25 #define PRINTF(...) 26 giet_tty_printf(__VA_ARGS__); \27 lock_release( &tty_lock);25 #define PRINTF(...) do { lock_acquire( &tty_lock ); \ 26 giet_tty_printf(__VA_ARGS__); \ 27 lock_release( &tty_lock ); } while(0); 28 28 29 29 //////////////////////////////////////////////////////////////////////////////////////// … … 166 166 uint32_t type = ( is_ac ) ? 1 : 0; 167 167 168 if ( is_ac ) { PRINTF("\n AC Huffman Table\n\n") } 169 else { PRINTF("\n DC Huffman Table\n\n") } 168 if ( is_ac ) 169 { 170 PRINTF("\n AC Huffman Table\n\n"); 171 } 172 else 173 { 174 PRINTF("\n DC Huffman Table\n\n"); 175 } 170 176 171 177 for ( j = 0; j < 16; j++ ) // j = code_length - 1 172 178 { 173 179 PRINTF(" length = %d / mincode = %x / maxcode = %x / valptr = %d\n", 174 j+1 , huff->MinCode[type][j] , huff->MaxCode[type][j] , huff->ValPtr[type][j] )175 } 176 177 PRINTF("\n") 180 j+1 , huff->MinCode[type][j] , huff->MaxCode[type][j] , huff->ValPtr[type][j]); 181 } 182 183 PRINTF("\n"); 178 184 179 185 for ( j = 0 ; j < 16 ; j++ ) // j == code_length - 1 … … 186 192 187 193 PRINTF(" Symbol[%d] = %x / code[%d] = %x\n", 188 index , huff->HT[type][index] , index , code ) 194 index , huff->HT[type][index] , index , code ); 189 195 } 190 196 } 191 197 192 PRINTF("\n") 198 PRINTF("\n"); 193 199 } 194 200 … … 342 348 #if (DEBUG_VLD > 2) 343 349 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 344 {PRINTF("\nVLD[%d] : DC[0] = %d / reformat( %x , %d ) = %d\n",345 index , buf[0], temp , symbol , value ) }350 PRINTF("\nVLD[%d] : DC[0] = %d / reformat( %x , %d ) = %d\n", 351 index , buf[0], temp , symbol , value ); 346 352 #endif 347 353 … … 357 363 #if (DEBUG_VLD > 2) 358 364 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 359 { PRINTF("\nVLD[%d] : EOB found at i = %d\n", index , i ) } 365 PRINTF("\nVLD[%d] : EOB found at i = %d\n", index , i ); 360 366 #endif 361 367 break; … … 379 385 #if (DEBUG_VLD > 2) 380 386 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 381 {PRINTF("\nVLD[%d] : AC[%d] = %d / reformat( %x , %d ) = %d\n",382 index , i , buf[i] , temp , cat , value ) }387 PRINTF("\nVLD[%d] : AC[%d] = %d / reformat( %x , %d ) = %d\n", 388 index , i , buf[i] , temp , cat , value ); 383 389 #endif 384 390 … … 390 396 #if (DEBUG_VLD > 1 ) 391 397 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 392 {PRINTF("\nVLD[%d] completes block %d/%d in image %d\n"398 PRINTF("\nVLD[%d] completes block %d/%d in image %d\n" 393 399 " %d %d %d %d %d %d %d %d\n" 394 400 " %d %d %d %d %d %d %d %d\n" … … 407 413 buf[40], buf[41], buf[42], buf[43], buf[44], buf[45], buf[46], buf[47], 408 414 buf[48], buf[49], buf[50], buf[51], buf[52], buf[53], buf[54], buf[55], 409 buf[56], buf[57], buf[58], buf[59], buf[60], buf[61], buf[62], buf[63]) }415 buf[56], buf[57], buf[58], buf[59], buf[60], buf[61], buf[62], buf[63]); 410 416 #endif 411 417 … … 442 448 443 449 PRINTF("\n[MJPEG] thread VLD[%d] starts on P[%d,%d,%d] / trdid = %x\n", 444 index , x , y , p, (uint32_t)trdid_vld[index] ) 450 index , x , y , p, (uint32_t)trdid_vld[index] ); 445 451 446 452 … … 452 458 #if (DEBUG_VLD > 1) 453 459 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 454 {PRINTF("\nVLD[%d] <in_data> : &mwmr = %x / &bufio = %x\n",455 index , mwmr_in_data , &bufio_in_data ) }460 PRINTF("\nVLD[%d] <in_data> : &mwmr = %x / &bufio = %x\n", 461 index , mwmr_in_data , &bufio_in_data ); 456 462 #endif 457 463 … … 463 469 #if (DEBUG_VLD > 1) 464 470 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 465 {PRINTF("\nVLD[%d] <in_huff> : &mwmr = %x / &bufio = %x\n",471 PRINTF("\nVLD[%d] <in_huff> : &mwmr = %x / &bufio = %x\n", 466 472 index , mwmr_in_huff , &bufio_in_huff ) } 467 473 #endif … … 483 489 #if (DEBUG_VLD > 1) 484 490 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 485 { PRINTF("\nVLD[%d] load Huffman tables for image %d\n", index , image ) } 491 PRINTF("\nVLD[%d] load Huffman tables for image %d\n", index , image ); 486 492 #endif 487 493 … … 501 507 #if (DEBUG_VLD > 1) 502 508 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 503 { PRINTF("\nVLD[%d] uncompress block %d/%d in image %d\n", index, block, nblocks, image ) } 509 PRINTF("\nVLD[%d] uncompress block %d/%d in image %d\n", index, block, nblocks, image ); 504 510 #endif 505 511 prev_dc = vld_unpack_block( index, … … 514 520 #if DEBUG_VLD 515 521 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 516 { PRINTF("\nVLD[%d] completes image %d at cycle %d\n", index , image , giet_proctime() ) } 522 PRINTF("\nVLD[%d] completes image %d at cycle %d\n", index , image , giet_proctime() ); 517 523 #endif 518 524 image = image + x_size*y_size;
Note: See TracChangeset
for help on using the changeset viewer.