We present here an MJPEG decoder. A detailed information about this example can be found in the technical report TR-2011-1.
The figure below illustrates the process network.
The process network in describes in the file examplemjpeg.xml. The behavior of the processes splitstream, splitframe, iqzigzagidct, mergeframe and mergestream are described respectively in the files splitstream.c, splitframe.c, iqzigzagidct.c, mergeframe.c, mergestream.c. The complete source is here.
To translate the DOL specifiation into BIP and execute the BIP model, do the following steps:
- Step1: Generate BIP application software model
~ $ $BIP2_HOME/bin/dol2bip -f examplemjpeg.xml
Creating tmp folder...
Parsing file : /tmp/DOL2BIP2927796489747548648tmp/libSW.bip
Generating model : libSW.timod
Generating model : libSW.model
Scanning process network ...
Process name: splitstream
Scanning source: splitstream.c
...............
Process name: splitframe_0
Scanning source: splitframe.c
Function unpack_block2 will be flattened... skipping code
Function load_quant_tables2 will be flattened... skipping code
...............
Process name: iqzigzagidct_0
Scanning source: iqzigzagidct.c
...............
Process name: mergeframe_0
Scanning source: mergeframe.c
...............
Process name: mergestream
Scanning source: mergestream.c
...............
Finished generation of examplemjpeg_SWModel.bip
Deleting tmp folderThe application software BIP model is generated in the file examplemjpeg_SWModel.bip. This can be compiled and executed using the BIP compiler and runtime as follows:
- Step2: Compile
~$ $BIP2_HOME/bin/bipc -f examplemjpeg_SWModel.bip --genC-execute
- Step3: Build
~ $ make -f examplemjpeg_SWModel.bip.mk
- Step4: Execute
~$ ./examplemjpeg_SWModel.bip.x --quiet
This will produce the decoded frames frame-00000.ppm and frame-00001.ppm.