SPECIAL TOPICS Video Multiple Description Coding (MDC)
Prof. Enrico Magli
Campione Salvatore Peraldo Lorenzo
145781 150327
Brief overview and general description The aim of this project is to point out the performances of a multiple description algorithm. The MDC algorithm used in this project is the temporal division: two descriptions of the same video (table.yuv, made of 30 frames, 352x288) are created by means of a MATLAB function (Multidescription.m); each description is characterized by 15 frames (one takes the even frame, table_sideR.yuv, and the other the odd frame, table_sideL.yuv). Then, H.264 encoder/decoder (last version available) is applied to each sequence and, by means of another MATLAB function (Reconstruction.m), the central description (i.e. the description obtained when both sequences are received) is reconstructed (table_recon.yuv). If only one of the two descriptions is received, an Interpolation algorithm has to be applied in order to obtain a 30-frame video; depending on which description (left or right) is received, a slightly different algorithm is implemented: InterpolationL.m and InterpolationR.m. A linear interpolation is used and where it couldn’t be applied, we just replicated one frame (i.e. last frame in odd description and first frame in even description). The goals are to carry out some graphs which relate: • Central PSNR vs Side PSNR • Side PSNR vs Bit-Rate • Side PSNR vs Quality factor • Bit-Rate comparison between a situation where MDC is used and where is not The PSNR data are computed using MSU Visual Quality Measurement Tools.
Simulation results Central PSNR vs Side PSNR The analysis is done with constant quality factor. The results are the following: QP 10 20 30 40 50
L Side PSNR 27,90 27,80 26,95 25,41 24,26
R Side PSNR 29,04 28,91 27,80 25,92 24,53
Central PSNR 51,89 42,04 32,84 27,86 25,37
Table 1: Central PSNR vs Side PSNR
Central VS Side PSNR 55
50
Central PSNR
45
40 Left Side Right Side
35
30
25
20 23
24
25
26
27
28
29
30
Side PSNR
Figure 1: Central PSNR vs Side PSNR Looking at the graph, you notice that the results are as those expected from the theoretical side. Side PSNR vs Bit-Rate This simulation compares the performances of both side descriptions in terms of PSNR vs Bit-Rate. Bitrate (kbit/s) 10051,74 3437,89 593,87 91,30 34,93
L Side PSNR 27,90 27,80 26,95 25,41 24,26
Bitrate (kbit/s) 10253,00 3699,00 612,37 94,06 35,14
R Side PSNR 29,04 28,91 27,80 25,92 24,53
Table 2: Side PSNR vs Bit-Rate PSNR vs Bit-rate 30
29
Side PSNR
28
27 Left Side Right Side
26
25
24
23 0,00
2000,00
4000,00
6000,00
8000,00
10000,00
Bit-rate (kbit/s)
Figure 2: Side PSNR vs Bit-Rate The results respect the theoretical ones.
12000,00
Side PSNR vs Quality factor This figure shows the previous one vs the quality factor instead of the bit-rate. QP 10 20 30 40 50
L Side PSNR 27,90 27,80 26,95 25,41 24,26
R Side PSNR 29,04 28,91 27,80 25,92 24,53
Table 3: Side PSNR vs Quality factor Side PSNRvs Quality Factor 30
29
28
Side PSNR
27
26 Left Side
25
Right Side
24
23
22
21 10
20
30
40
50
Quality Factor
Figure 3: Side PSNR vs Quality factor Bit-Rate comparison between a situation where MDC is used and where is not In this analysis, we compare MDC with a Single Description implementation. The simulation is carried out with the same quality factor; this means that the PSNR in presence of MDC is almost equal to the one in absence of MDC. For this reason, the comparison can be done looking at the Bit-Rate. The Bit-Rate of the reconstructed files is computed summing the two side bit-rate of the side descriptions. Central PSNR no MDC 51,79 41,66 32,64 27,78 25,28
Central PSNR MDC 51,89 42,04 32,84 27,86 25,37
Bit-Rate no MDC (kbit/s) 9193,82 2747,87 486,19 71,44 27,84
Bit-Rate MDC (kbit/s) 20304,74 7136,89 1206,24 185,36 70,07
Bitrate Left Side (kbit/s) 10051,74 3437,89 593,87 91,30 34,93
Bitrate Right Side (kbit/s) 10253,00 3699,00 612,37 94,06 35,14
Table 4: Bit-Rate comparison between a situation where MDC is used and where is not
Bitrate comparison 25000
BitRate [Kbit/s]
20000
15000 without MDC with MDC Right Side Left Side 10000
5000
0 0
10
20
30
40
50
60
QP
Figure 4: Bit-Rate comparison between a situation where MDC is used and where is not As you can see from the graph, the Bit-Rate in presence of MDC is higher than the one without MDC, as expected from theoretical results.
Appendix Multidescription.m clc; or_path='table.yuv'; % Original file dest_pathL = 'table_sideL.yuv'; dest_pathR = 'table_sideR.yuv'; height=288; width=352; N=30; frame_size=height*width*1.5; f_or = fopen(or_path,'rb'); original = fread(f_or); fclose(f_or); flag = 0; sideL = []; sideR = []; for i=0:N-1 if(flag == 0) sideL= [sideL ; original(i*frame_size+1:(i+1)*frame_size)]; flag = 1; else sideR= [sideR ; original(i*frame_size+1:(i+1)*frame_size)]; flag=0; end end f_dst=fopen(dest_pathL,'wb'); fwrite(f_dst,sideL,'uint8'); fclose(f_dst); f_dst=fopen(dest_pathR,'wb'); fwrite(f_dst,sideR,'uint8'); fclose(f_dst);
Reconstruction.m clc f_orL=fopen('table_sideL.yuv','rb'); f_orR=fopen('table_sideR.yuv','rb'); originalL=fread(f_orL); originalR=fread(f_orR); fclose(f_orL); fclose(f_orR); height=288; width=352; N=30; frame_size=height*width*1.5; f_rec=fopen('table_recon.yuv','a'); for i=0:N/2-1 fwrite(f_rec, originalL(i*frame_size+1:(i+1)*frame_size), 'uint8'); fwrite(f_rec, originalR(i*frame_size+1:(i+1)*frame_size), 'uint8'); end fclose(f_rec); InterpolationL.m clc or_path='table_sideL_50.yuv'; % Original file dest_pathL = 'table_sideL_50_30frames.yuv'; f_or = fopen(or_path,'rb'); original = fread(f_or); fclose(f_or); height=288; width=352; N=30; frame_size=height*width*1.5; new = []; for i=0:N/2-2 new = [new ; original(i*frame_size+1:(i+1)*frame_size)]; new = [new ; (original(i*frame_size+1:(i+1)*frame_size)+original((i +1)*frame_size+1:(i+2)*frame_size) )/2]; end new = [new ; original(i*frame_size+1:(i+1)*frame_size)]; new = [new ; original(i*frame_size+1:(i+1)*frame_size)]; f_dst=fopen(dest_pathL,'wb'); fwrite(f_dst,new,'uint8'); fclose(f_dst);
InterpolationR.m clc or_path='table_sideR_50.yuv'; % Original file dest_pathL = 'table_sideR_50_30frames.yuv'; f_or = fopen(or_path,'rb'); original = fread(f_or); fclose(f_or); height=288; width=352; N=30; frame_size=height*width*1.5; new = []; i=0; new = [new ; original(i*frame_size+1:(i+1)*frame_size)]; for i=0:N/2-2 new = [new ; original(i*frame_size+1:(i+1)*frame_size)]; new = [new ; (original(i*frame_size+1:(i+1)*frame_size)+original((i +1)*frame_size+1:(i+2)*frame_size) )/2]; end new = [new ; original(i*frame_size+1:(i+1)*frame_size)]; f_dst=fopen(dest_pathL,'wb'); fwrite(f_dst,new,'uint8'); fclose(f_dst);