Changeset 736 for soft/giet_vm/applications/mjpeg/iqzz.c
- Timestamp:
- Dec 3, 2015, 4:40:49 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/mjpeg/iqzz.c
r723 r736 39 39 uint32_t block; 40 40 uint32_t i; 41 uint8_t QT able[64];// Quantisation Table / 1 byte per pixel42 int16_t b ufin[64]; // Input data buffer / 2 bytes per pixel43 int32_t b ufout[64]; // Output data buffer / 4 bytes per pixel41 uint8_t QT[64]; // Quantisation Table / 1 byte per pixel 42 int16_t bin[64]; // Input data buffer / 2 bytes per pixel 43 int32_t bout[64]; // Output data buffer / 4 bytes per pixel 44 44 45 45 uint32_t nblocks = nblocks_w * nblocks_h; … … 55 55 giet_proc_xyp( &x , &y , &p ); 56 56 57 PRINTF("\n[MJPEG] thread IQZZ[%d] starts on P[%d,%d,%d]\n", index, x, y, p ) 57 PRINTF("\n[MJPEG] thread IQZZ[%d] starts on P[%d,%d,%d] / trdid = %x\n", 58 index , x , y , p, (uint32_t)trdid_iqzz[index] ) 59 58 60 59 61 uint32_t image = index; … … 62 64 { 63 65 // read the quantization coefs from mwmr_in_quanti (one byte per coef) 64 mwmr_read( mwmr_in_quanti , (uint32_t*)QT able, 16 );66 mwmr_read( mwmr_in_quanti , (uint32_t*)QT , 16 ); 65 67 66 68 #if (DEBUG_IQZZ > 1) 67 PRINTF("\nIQZZ[%d] get quantisation coefs for image %d\n", index , image ) 69 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 70 { PRINTF("\nIQZZ[%d] get quantisation coefs for image %d\n" 71 "%d %d %d %d %d %d %d %d\n" 72 "%d %d %d %d %d %d %d %d\n" 73 "%d %d %d %d %d %d %d %d\n" 74 "%d %d %d %d %d %d %d %d\n" 75 "%d %d %d %d %d %d %d %d\n" 76 "%d %d %d %d %d %d %d %d\n" 77 "%d %d %d %d %d %d %d %d\n" 78 "%d %d %d %d %d %d %d %d\n", 79 index , image , 80 QT[ 0],QT[ 1],QT[ 2],QT[ 3],QT[ 4],QT[ 5],QT[ 6],QT[ 7], 81 QT[ 8],QT[ 9],QT[10],QT[11],QT[12],QT[13],QT[14],QT[15], 82 QT[16],QT[17],QT[18],QT[19],QT[20],QT[21],QT[22],QT[23], 83 QT[24],QT[25],QT[26],QT[27],QT[28],QT[29],QT[30],QT[31], 84 QT[32],QT[33],QT[34],QT[35],QT[36],QT[37],QT[38],QT[39], 85 QT[40],QT[41],QT[42],QT[43],QT[44],QT[45],QT[46],QT[47], 86 QT[48],QT[49],QT[50],QT[51],QT[52],QT[53],QT[54],QT[55], 87 QT[56],QT[57],QT[58],QT[59],QT[60],QT[61],QT[62],QT[63] ) } 68 88 #endif 69 89 … … 71 91 { 72 92 // read one block from mwmr_in_data (2 bytes per pixel) 73 mwmr_read( mwmr_in_data , (uint32_t*)b ufin , 32 );93 mwmr_read( mwmr_in_data , (uint32_t*)bin , 32 ); 74 94 75 95 // unquantify & UnZZ each pixel 76 96 for ( i = 0 ; i < 64 ; ++i ) 77 97 { 78 b ufout[G_ZZ[i]] = bufin[i] * QTable[i];98 bout[G_ZZ[i]] = bin[i] * QT[i]; 79 99 } 80 100 81 101 // write one block to IDCT / 4 bytes per pixel 82 mwmr_write( mwmr_out_data , (uint32_t*)b ufout , 64 );102 mwmr_write( mwmr_out_data , (uint32_t*)bout , 64 ); 83 103 84 104 #if (DEBUG_IQZZ > 1) 85 PRINTF("\nIQZZ[%d] completes block %d/%d in image %d\n", 86 index , block , nblocks , image ) 87 PRINTF(" %d %d %d %d %d %d %d %d\n" 88 " %d %d %d %d %d %d %d %d\n" 89 " %d %d %d %d %d %d %d %d\n" 90 " %d %d %d %d %d %d %d %d\n" 91 " %d %d %d %d %d %d %d %d\n" 92 " %d %d %d %d %d %d %d %d\n" 93 " %d %d %d %d %d %d %d %d\n" 94 " %d %d %d %d %d %d %d %d\n", 95 bufout[0] , bufout[1] , bufout[2] , bufout[3] , bufout[4] , bufout[5] , bufout[6] , bufout[7] , 96 bufout[8] , bufout[9] , bufout[10], bufout[11], bufout[12], bufout[13], bufout[14], bufout[15], 97 bufout[16], bufout[17], bufout[18], bufout[19], bufout[20], bufout[21], bufout[22], bufout[23], 98 bufout[24], bufout[25], bufout[26], bufout[27], bufout[28], bufout[29], bufout[30], bufout[31], 99 bufout[32], bufout[33], bufout[34], bufout[35], bufout[36], bufout[37], bufout[38], bufout[39], 100 bufout[40], bufout[41], bufout[42], bufout[43], bufout[44], bufout[45], bufout[46], bufout[47], 101 bufout[48], bufout[49], bufout[50], bufout[51], bufout[52], bufout[53], bufout[54], bufout[55], 102 bufout[56], bufout[57], bufout[58], bufout[59], bufout[60], bufout[61], bufout[62], bufout[63]) 105 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 106 { PRINTF("\nIQZZ[%d] completes block %d/%d in image %d\n" 107 " %d %d %d %d %d %d %d %d\n" 108 " %d %d %d %d %d %d %d %d\n" 109 " %d %d %d %d %d %d %d %d\n" 110 " %d %d %d %d %d %d %d %d\n" 111 " %d %d %d %d %d %d %d %d\n" 112 " %d %d %d %d %d %d %d %d\n" 113 " %d %d %d %d %d %d %d %d\n" 114 " %d %d %d %d %d %d %d %d\n", 115 index , block , nblocks , image , 116 bout[0] , bout[1] , bout[2] , bout[3] , bout[4] , bout[5] , bout[6] , bout[7] , 117 bout[8] , bout[9] , bout[10], bout[11], bout[12], bout[13], bout[14], bout[15], 118 bout[16], bout[17], bout[18], bout[19], bout[20], bout[21], bout[22], bout[23], 119 bout[24], bout[25], bout[26], bout[27], bout[28], bout[29], bout[30], bout[31], 120 bout[32], bout[33], bout[34], bout[35], bout[36], bout[37], bout[38], bout[39], 121 bout[40], bout[41], bout[42], bout[43], bout[44], bout[45], bout[46], bout[47], 122 bout[48], bout[49], bout[50], bout[51], bout[52], bout[53], bout[54], bout[55], 123 bout[56], bout[57], bout[58], bout[59], bout[60], bout[61], bout[62], bout[63]) } 103 124 #endif 104 125 } // end for blocks 105 126 106 127 #if DEBUG_IQZZ 107 PRINTF("\nIQZZ[%d] completes image %d at cycle %d\n", index , image , giet_proctime() ) 128 if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) ) 129 { PRINTF("\nIQZZ[%d] completes image %d at cycle %d\n", index , image , giet_proctime() ) } 108 130 #endif 109 131 … … 112 134 } // end while(1) on images 113 135 114 giet_pthread_exit( " iqzzcompleted" );136 giet_pthread_exit( "IQZZ completed" ); 115 137 116 138 } // end iqzz()
Note: See TracChangeset
for help on using the changeset viewer.