/* * Copyright 2005 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ /** * @description * This file contains a sample MPEGtoBMP converter. It generates a bitmap * file for every frame of input in the video. Do to a limitation of the compiler, * which manifests itself in excessive memory usage, it currently only outputs the * first five frames of the video, although one can change that number in this file if * they want to try a different number. * * @author Matthew Drake * @file MPEGtoBMP.str * @version 1.0 */ void->void pipeline MPEGtoBMP() { // add FileReader("../input/nomessage.m2v"); // Use this one for the nomessage decoder add FileReader("../input/cact_015.m2v"); // For compiling outside the library, if support has not yet been added for FileReader // substitute the following, which will cause a slight performance hit. // add FileReader("../input/cact_015.m2v"); // add IntStream2BitStream(); int width=352; // Hacked till we have reprogrammable splitjoins FEATURETODO int height=240; add MPEGStream_to_rawImageStream(width, height, 1); add int->void splitjoin { split roundrobin(width*height*3); // TODO Hardcoded to only generate 3 frames of output for (int i = 0; i < 3; i++) { add int->void pipeline { add rawImageStream_to_BMPStream(width, height); add FileWriter("./output" + i + ".bmp"); // For compiling outside the library, if support has not yet been added for FileReader // substitute the following, which will cause a slight performance hit. // add BitStream2IntStream(); // add FileWriter("./output" + i + ".bmp"); } } join roundrobin(0); } }