Course
“Operating Systems” (OS)
Project
General
Information
The goal of
this project is to
teach you basics of multitask programming. More precisely, you will
learn how to program a MPEG-based video encoding system with a
mono-process / thread approach, and with a multi-process / thread
approach. I provide you with encoding algorithms, you just need to care
about writing process / thread architecture and data
structures.
To help you
starting your project, I suggest that you attend
course session #5 and lab session #1. You may also come to my office to
ask me questions, go to the library and consult
or
borrow appropriate books and documents.
You can get more
information on MPEG1 through the following links. Also
note that our encoder has Group Of Pictures composed of 8 images, one
Intra Image
and seven Predicted
Images. We won't use Bidirectional
Images, it will be useless for this project to get more information on
these.
MPEG
stream
overview
Berkeley
Encoder : MPEG overview...
And much more information!
Before starting the
project, you'd better know what I-Frames and
P-Frames are and how they are encoded. You may also know what are RGB
and YUV image format, and be aware of the MPEG file structure (Group Of
Pictures -GoP-, different kinds of headers...)
Here is an overview of
what appli1 should be like in the end:
- Create and Allocate structures
- Check the arguments
- Get the Input File Size and create a Read-Buffer of the
same size
- Create the Output File and set the output mechanisms
- Encode the MpegSequence header
- For each Group Of Pictures:
- Init and Encode the GoP Header
- Read Intra Image, convert it, encode it and store it in a
buffer with its header
- Previous Image becomes the current one, past previous one
may
be overwritten.
- For each Predicted Image:
- Read Image, encode it as a function of the previous
one, and
store it with its header
- Previous Image becomes the current one, past previous
one may
be overwritten.
- Write in .mpeg file and empty buffer
- Write the Mpeg Sequence End Code in the .mepg file
- Free all datas
Schedule
- You source file and reports are
due for the
31st of January.
- Send me your
project directory
by email at ludovic.apvrille@enst.
Do not name your archive
"project.tar.gz" but rather "project_<last name>.tar.gz".
Information
on
Project Directory
Your project directory
should contain
the following subdirectories:
- bin: binaries files i.e. your two executable applications.
- src: source files
- doc: your report
- lib: all used libraries (.o files)
- video: produced video.
In the root directory,
place your
makefile. An example Makefile is provided in section "Work to do".
Also, do provide a README file.
Once uncompressed, I should be able to compile your two applications by
typing:
make appli1
make appli2
make clean
should perform a
clean on all files that may be generated from the Makefile (.o, and
executable files).
Send me a clean project, i.e. without the encoded video, and without .o
and executable files.
The parameters given to these applications are:
- First, the Input File name prefix. Your code should read
files
with
names like <thisprefix>024.ppm , i.e. it adds the
picture
number (3 digits) and the .ppm suffix at the end.
- Second, the name of the mpeg-file to be created. Don't
forget
that your appplication should generate the video file in the video/
directory.
Grading
Work on your own!
Each project must be personnaly
achieved.
Similar source files or reports is prohibited, and
therefore results in bad grades.
Report
Your report should contain information related to:
- Implementation issues
(organization of
your code, algorithms, implementation choices such as the architecture
of your applications, used data structures and so on). You must justify
your different choices, or at least present them.
- Performance
issues. You should
evaluate your application in terms of CPU performance (time to compress
the video) and in terms of memory footprint. Do compare your mono
process application with your multi process / thread one, and comment
the results. Also, you may compare your results with other students,
and try to explain them.
Work to
do
- Complete the code of a
mono-process
mono-thread application that can encode MPEG stream from provided
images.
- Program the same
application with a
multi-process or / and multi-thread approach.
- Evaluate the performance
of both
applications.
- Provide a report.
I do provide a first project directory to start from:
Source images are located into /homes/teaching/courses/OS/img/
DO NOT copy these source images into your account, simply use them from that directory.
Download this compressed
project file,
uncompress it (gunzip
OSproject.tar.gz)
and un-archive it (tar
-xof
OSproject.tar.gz).
The src directory
contains a file
named appli1.c in which you should complete the first application's
code.
At first, you should complete the
mono-process
application. Two sections must be added, a few comments indicate
you what to do.
Once written, you may
compile your
application by typing, from the project's root directory:
make
appli1
Test your first
application.
To start your application, type, from your project's root directory:
./bin/appli1 /homes/teaching/courses/OS/img/pingpong-i0
./video/maVideo.mpeg
Then,
check that your video is correctly encoded with mplayer (mplayer filename).
To erase files generated by the Makefile, you may type:
make clean
Then, do the second application.
First think about a possible multi process / thread architecture and of
data strutures (it's the most important part of your personal work),
and program them. You will also have to modify the makefile so that 'make appli1' and 'make appli2' both compile.
Test your application, and evaluate
the performance of the second one with regard to the first
one.
No extra material is
provided for
application 2. It is up to you to modify the Makefile (change what
files must be erased when running make clean, etc.), to create new C
files, etc.