private void stackLineByLine (int[] src, double[][] dst, int frameNo, int width, int height) {
        for (int y = 0; y < height; y++) {
           for (int x = 0; x < width; x++) {
                // dst[][] is a (width * height) by gopSize matrix,
                // with line by line of src pics stacked as columns of new arrays.
               dst[y * width + x][frameNo] = (double)src[y * width + x];
            } 
        }
    }