quality: this argument is the quality factor used by the JPEG-like quantizer. It ranges from 0-100; however our application experiences unknown issues at qualities higher than 70. Please limit this value to 70.
frame: this argument specifies the end frame of the video sequence. For the Foreman sequence, this value will be 400.
blkx: this argument is the size of the motion estimation block in the x direction.
blky: this argument is the size of the motion estimation block in the y direction.
searchrange: this argument is the value of the search range used in motion estimation. Note: this value should be double the size of blkx and blky. Any other ratio will result in an error.
% This function serves as the starting point for running
% the entire codec. Please refer to the report for a full
% description on all of the function arguments
function [PSNR] = main(sequence, d_sequence, bitfile, quality, frame, blkx, blky, searchrange, height, width)
% initialize used variables
MSE = zeros(1,frame);
PSNR = zeros(1,frame);
% encodes the desired sequence
baseline_enc (sequence, bitfile, quality, frame, blkx, blky, searchrange, height, width);
% decodes the same encoded sequence
baseline_dec (d_sequence, bitfile, frame, blkx, blky, height, width);
% calculates the PSNR between the original and decoded sequence
original_frame = read_Yframe (sequence, height, width, i);
decoded_frame = read_Yframe (d_sequence, height, width, i);
[r,c] = size(original_frame);
MSE(i) = sum(sum((original_frame-decoded_frame).^2))/(r*c);
PSNR(i) = 10*log10((255^2)/MSE(i));
% transposes final PSNR vector for easy graphing
PSNR = PSNR';
height: this argument takes in the height of the original Y file.
width: this argument takes in the width of the original Y file.
By executing the main file, you are executing both the encoder application and the decoder application respectively. Also, at the end of the main program, the PSNR is calculated and stored in the workspace for your convenience.
To calculate the total number of bytes required to encode the video sequence you will need to select all output files and using the right mouse button, determine the total size. Since we are using adaptive arithmetic coding, the output files consist of the compressed bitstream files for each frame (1-400), the compressed bitstream files for each motion vector (2-400) and the header files (1-400).
Assignmenthelp.net is a platform for getting 3d gui project of matlab online help. Here you can find online assignment matlab expert who provide 3d project on matlab, all matlab projects codes, assignment help matlab tutor, GUI matlab project, MATLAB assignment homework etc.