Changeset 736 for soft/giet_vm/applications/mjpeg/vld.c
- Timestamp:
- Dec 3, 2015, 4:40:49 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/mjpeg/vld.c
r723 r736 193 193 } 194 194 195 //////////////////////////////////////////// 196 void huff_tables_load( huff_tables_t* huff, 195 ///////////////////////////////////////////// 196 void huff_tables_load( uint32_t index, 197 huff_tables_t* huff, 197 198 mwmr_bufio_t* bufio ) 198 199 { … … 253 254 mwmr_bufio_align( bufio ); 254 255 255 #if (DEBUG_VLD > 2) 256 #if (DEBUG_VLD > 3) 257 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 256 258 huff_tables_dump( huff , is_ac ); 257 259 #endif … … 312 314 // unpack a 8*8 pixels block with 2 bytes per pixel 313 315 ////////////////////////////////////////////////////////// 314 static int16_t vld_unpack_block( bitreader_t* stream, 315 mwmr_channel_t* mwmr_out, 316 huff_tables_t* huff, 317 int16_t prev_dc ) 316 static int16_t vld_unpack_block( uint32_t index, // cluster index 317 uint32_t image, // image index 318 uint32_t block, // block index 319 bitreader_t* stream, // input bit stream 320 mwmr_channel_t* mwmr_out, // output channel 321 huff_tables_t* huff, // Huffman Tables 322 int16_t prev_dc ) // previous DC coef 318 323 { 319 324 uint32_t temp; … … 335 340 buf[0] = value + prev_dc; 336 341 337 #if (DEBUG_VLD > 1) 338 PRINTF("\nDC[0] = %d / reformat( %x , %d ) = %d\n", buf[0], temp , symbol , value ) 342 #if (DEBUG_VLD > 2) 343 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 ) } 339 346 #endif 340 347 … … 348 355 { 349 356 350 #if (DEBUG_VLD > 1) 351 PRINTF("EOB found at i = %d\n", i ); 357 #if (DEBUG_VLD > 2) 358 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 359 { PRINTF("\nVLD[%d] : EOB found at i = %d\n", index , i ) } 352 360 #endif 353 361 break; … … 370 378 371 379 #if (DEBUG_VLD > 2) 372 PRINTF("AC[%d] = %d / reformat( %x , %d ) = %d\n", i , buf[i] , temp , cat , value ) 380 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 ) } 373 383 #endif 374 384 … … 379 389 380 390 #if (DEBUG_VLD > 1 ) 381 PRINTF(" %d %d %d %d %d %d %d %d\n" 382 " %d %d %d %d %d %d %d %d\n" 383 " %d %d %d %d %d %d %d %d\n" 384 " %d %d %d %d %d %d %d %d\n" 385 " %d %d %d %d %d %d %d %d\n" 386 " %d %d %d %d %d %d %d %d\n" 387 " %d %d %d %d %d %d %d %d\n" 388 " %d %d %d %d %d %d %d %d\n", 389 buf[0] , buf[1] , buf[2] , buf[3] , buf[4] , buf[5] , buf[6] , buf[7] , 390 buf[8] , buf[9] , buf[10], buf[11], buf[12], buf[13], buf[14], buf[15], 391 buf[16], buf[17], buf[18], buf[19], buf[20], buf[21], buf[22], buf[23], 392 buf[24], buf[25], buf[26], buf[27], buf[28], buf[29], buf[30], buf[31], 393 buf[32], buf[33], buf[34], buf[35], buf[36], buf[37], buf[38], buf[39], 394 buf[40], buf[41], buf[42], buf[43], buf[44], buf[45], buf[46], buf[47], 395 buf[48], buf[49], buf[50], buf[51], buf[52], buf[53], buf[54], buf[55], 396 buf[56], buf[57], buf[58], buf[59], buf[60], buf[61], buf[62], buf[63]) 391 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 392 { PRINTF("\nVLD[%d] completes block %d/%d in image %d\n" 393 " %d %d %d %d %d %d %d %d\n" 394 " %d %d %d %d %d %d %d %d\n" 395 " %d %d %d %d %d %d %d %d\n" 396 " %d %d %d %d %d %d %d %d\n" 397 " %d %d %d %d %d %d %d %d\n" 398 " %d %d %d %d %d %d %d %d\n" 399 " %d %d %d %d %d %d %d %d\n" 400 " %d %d %d %d %d %d %d %d\n", 401 index , block , nblocks_w*nblocks_h , image , 402 buf[0] , buf[1] , buf[2] , buf[3] , buf[4] , buf[5] , buf[6] , buf[7] , 403 buf[8] , buf[9] , buf[10], buf[11], buf[12], buf[13], buf[14], buf[15], 404 buf[16], buf[17], buf[18], buf[19], buf[20], buf[21], buf[22], buf[23], 405 buf[24], buf[25], buf[26], buf[27], buf[28], buf[29], buf[30], buf[31], 406 buf[32], buf[33], buf[34], buf[35], buf[36], buf[37], buf[38], buf[39], 407 buf[40], buf[41], buf[42], buf[43], buf[44], buf[45], buf[46], buf[47], 408 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]) } 397 410 #endif 398 411 … … 428 441 // giet_tty_alloc( 0 ); 429 442 430 PRINTF("\n[MJPEG] thread VLD[%d] starts on P[%d,%d,%d]\n" , index, x, y ,p ) 443 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] ) 445 431 446 432 447 // initialise BUFIO for MWMR channel <in_data> … … 436 451 437 452 #if (DEBUG_VLD > 1) 438 PRINTF("\nVLD[%d] <in_data> : &mwmr = %x / &bufio = %x\n", 439 index , mwmr_in_data , &bufio_in_data ) 453 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 ) } 440 456 #endif 441 457 … … 446 462 447 463 #if (DEBUG_VLD > 1) 448 PRINTF("\nVLD[%d] <in_huff> : &mwmr = %x / &bufio = %x\n", 449 index , mwmr_in_huff , &bufio_in_huff ) 464 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 465 { PRINTF("\nVLD[%d] <in_huff> : &mwmr = %x / &bufio = %x\n", 466 index , mwmr_in_huff , &bufio_in_huff ) } 450 467 #endif 451 468 … … 459 476 { 460 477 // load first Huffman Table from bufio_in_huff 461 huff_tables_load( &huff , &bufio_in_huff );478 huff_tables_load( index, &huff , &bufio_in_huff ); 462 479 463 480 // load second Huffman Table from bufio_in_huff 464 huff_tables_load( &huff , &bufio_in_huff );481 huff_tables_load( index, &huff , &bufio_in_huff ); 465 482 466 483 #if (DEBUG_VLD > 1) 467 PRINTF("\nVLD[%d] load Huffman tables for image %d\n", index , image ) 484 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 485 { PRINTF("\nVLD[%d] load Huffman tables for image %d\n", index , image ) } 468 486 #endif 469 487 … … 482 500 483 501 #if (DEBUG_VLD > 1) 484 PRINTF("\nVLD[%d] uncompress block %d/%d in image %d\n", index, block, nblocks, image ) 485 #endif 486 prev_dc = vld_unpack_block( &stream , mwmr_out, &huff , prev_dc ); 502 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 ) } 504 #endif 505 prev_dc = vld_unpack_block( index, 506 image, 507 block, 508 &stream, 509 mwmr_out, 510 &huff, 511 prev_dc ); 487 512 } // end for blocks 488 513 489 514 #if DEBUG_VLD 490 PRINTF("\nVLD[%d] completes image %d at cycle %d\n", index , image , giet_proctime() ) 515 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 516 { PRINTF("\nVLD[%d] completes image %d at cycle %d\n", index , image , giet_proctime() ) } 491 517 #endif 492 518 image = image + x_size*y_size; … … 494 520 } // end while on images 495 521 496 giet_pthread_exit( " vldcompleted" );522 giet_pthread_exit( "VLD completed" ); 497 523 498 524 } // end vld()
Note: See TracChangeset
for help on using the changeset viewer.