TKT-2431 SoC design Implementing the specification
General o o o o o Implement the specification for verification onto PC Implement main.c Do not modify the pre-given codes (other than main.c and possibly headers.h) You may use given makefile for compiling your codes makefile is available in course web pages Verify your implementation using the tools introduced in the previous exercise Start writing an implementation document
Design Flow current status Requirements Specification Performance analysis Documentation SW Implementation Performance analysis Verification HW/SW partitioning Performance analysis Final Implementation
Encoder flow an example Start Last frame? Yes End No Next frame Code Picture Header Yes Last y-axis? No Next y-axis Last x-axis? No Yes Get MB DCT MB Quantize MB Code Intra MB Next x-axis
Implementation o Complete the main.c Reserve memory for a qcif-sized image (38016 bytes) Declare variables Open input and output files Initialize variables and bitstream buffers Read frame from input file Put H.263 picture header to bit stream Perform encoding functions for each MB in loop Do not forget to align bitstream after each frame
Main code an example #include "headers.h" #include <assert.h> vbool main(){ PictureType pictinfo; sint32 frameposition; sint32 lastframe; uint8 currentimage[38016]; uint8 *input_data; MBType currentmb; sint32 xmb, ymb; BitStreamType bitstream; vchar inputfilename[] = \home\home_dir\soc_design\carphone.qcif"; vchar streamfilename[] = \home\home_dir\soc_design\carphone.263"; FILE *inputfile = NULL; FILE *outputfile = NULL; } /* Reserve space for MB data. */ /* Space for one extra block is needed due to the utilized sw dct-algorithm */ currentmb.data = (sint16 *)malloc(sizeof(sint16) * 64*(6+1)); input_data = (uint8 *)malloc(sizeof(uint32) * (64/4)*(6+1)); /* Open input file */ inputfile = yuvopeninputfile( inputfilename, &lastframe); assert(inputfile!= NULL);...
Compilation o Compile and verify the implementation You may do this in any environment you want (MS Visual Studio, GNU tools) Do not use any tool specific structures in your C code All the tools can be found from the PCs of the class Currently, the pre-given codes work only with little-endian processor architecture. o To use Gnu tools login to unix/linux/cygwin machine > gcc help o You may also utilize the makefile available in course web pages to compile you program in PC environment o The input frame sequence can also be downloaded from web site carphone.qcif
Verification o To verify the correctness of the bitstream use H.263 decoder (tmndec) installed on the PCs of the class. Play your bitstream using tmndec (with o4 option). At least your bitstream is legal if the decoder does not give any warnings or errors during decoding. Compare visually the encoded/decoded frames with original frames.
Implementation document o In addition to specification, you have to document also the implementation o The implementation document will be part of the final report of the whole project work o The document will be written during the different phases of the project Returned at the end of the project work o The form of the document is free. However, at least the following things should be added to the document at this point: Main code (main.c) enclosed. Description and usage of main. Verification description. Description of the project progress. Problems
Return o Return: Main program (main.c). Possible other source code files you have implemented in addition to the pre-given ones. Encoded bitstream (named as carphone.263) of carphone.qcif. Did the encoded/decoded video sequence differ from the original one. Why or why not? (Give a short answer in the e-mail) Do not return the implementation document, although you might have started writing it Time usage (in the email body) o Estimate how many hours your group has spent on doing this specific exercise return. o How many hours you expected it to take before you started implementing the return? o Remember: Return possible mail attachments in pdf or txt -format E-mail to juha.arvio@tut.fi (or tero.arpinen@tut.fi in case of English groups) Subject of e-mail: o SOCD_Ex3_G<group_number> Deadline for the return is on Monday 5.10.2009