optimize qrcode.js

use one dimension array and shift to process grayscale