public void writePic(String filename, int width, int height, int framesToBeWritten, ArrayList<Picture> picList) {
		int widthC = width >> 1;
		int heightC = height >> 1;
        startWriting(filename, width, widthC);
        
        Picture picTemp; 
        for (int framesNo = 0; framesNo < framesToBeWritten; framesNo++) {
            picTemp = picList.get(framesNo);
            writePlane(picTemp.getY(), oneLineY, width, height); 
            writePlane(picTemp.getCb(), oneLineCbCr, widthC, heightC);  
            writePlane(picTemp.getCr(), oneLineCbCr, widthC, heightC);    
        }

        endWriting();
	}