public static byte[][] AllocJpegSamples(int samplesPerRow, int numberOfRows) { byte[][] result = new byte[numberOfRows][]; for (int i = 0; i < numberOfRows; ++i) result[i] = new byte[samplesPerRow]; return result; }