private void expand(double[] array, int lay) {
        int k = 0;
        for (int i = 0; i < HEIGHT; i++) {
            for (int j = 0; j < HEIGHT; j++) {
                yCbCr[i][j][lay] = array[k++];
            }
        }
    }