Вы находитесь на странице: 1из 13

POC

1. start 2. input string 3. Mode = mode(string) // Mode of string to be encoded. 3 output.append(Mode) 4. len = length(string) & mode(string).type // no: of bits needed to represent string length 5. output.append(len) 6. string_split[] = string.split(2) // split input into group of two 7. while(string_split[i]) 7.1 pair_val = 45 * ascii(string_split[i][0]) + ascii(string_split[i][1]) // for each pair calculate as shown 7.2 if(length(string_split[i])<2) 7.2.1 pair_val = pair_val & 111111 7.3 else 7.3.2 pair_val = pair_val & 11111111111 // make output value to length of 11 in binary format 7.4 output.append(pair_val) 8. while length(output) != Mode[REQ_Length] 8.1 output.append(0) 8.2 increment counter 8.3 if counter == 4 then break 9 outp_split[] = output.split(8)

10 if length(outp_split[-1]) != 8 10.1 output.append(0) 10.2 goto 10 11 while(length(output)< Mode[REQ_Length]) 11.1 append values 11101100 and 00010001 alternatively 12. Lookup error conversion table with level input 13. while(outp_split[]) // to generate message polynomial 13.1 poly[i] = poly[i] + DataBlockNo + ECWordsNo - 1 13.2 coeff[i] = decimal(outp_split[i]) 14. Generate generator polynomial with Galois field. 15. Ex-Or Message polynomial wit generator polynomial exponents 16. Output resulting binary string to DataVals 17. while(!DataFlag[a][b]) 17.1 QR[k][a][b] = QRP[k][a][b] // Copying postion and type info bits to output matrix QR from first of 8 QR masking patterns which is common to all patterns

18. while k<8 18.1 while !QR_END // if both position and type flags are not set 18.1.1 QR[k][a][b] = QRP[k][a][b] EXOR DataVals[a*Row + b] // here Row is no. of elements in a row 18.1.2 if QR[k][a][b] == 0 // If the cell is set as black 18.1.2.1 increment blCounter[k] 18.1.3 if poslfag or tflag is set, skip cell and increment counter 18.2 for l = 0 to Row 18.2.1 for j = 0 to Col 18.2.1.1 val = 0 18.2.1.2 for i = j to j+5 18.2.1.2.1 if QR[k][a][i] == 0 then increment val 18.2.1.3 if val == 0 or val == 5 penalty[k] = penalty[k] + 1 18.2.1.4 if QR[k][i][j] == QR[k][i][j+1] && QR[k][i][j+1] == QR[k][i+1][j] && QR[k][i+1][j+1] == QR[k][i+1][j] 18.2.1.4.1 penalty[k] = penalty[k] + 1 18.3 if blcounter[k] > Threshold // Large penalty for large amount of black data 18.3.1 penalty[k] = penalty[k] + 5 19 k = min(penalty) // Finds minimum value from penalty arrra and returns index 20 Output corresponding pattern to FinalQR 21 Stop

Thank You

Вам также может понравиться