-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtestscript.m
53 lines (36 loc) · 1.47 KB
/
testscript.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
clc
clear
close all
width = 176;
height = 144;
blocksizerow = 18;
blocksizecol = 18;
filtlength1 = 7;
filtlength2 = 7;
filtlength = [filtlength1 filtlength2];
blockrowoverlap = 8;
blockcoloverlap = 8;
% Compute the score for a distorted video
vidname = 'foreman_dst_qcif.yuv';
filep = dir(vidname);
fileBytes = filep.bytes; %Filesize
fwidth = 0.5;
fheight = 0.5;
clear filep
framenumber = fileBytes/(width*height*(1+2*fheight*fwidth)); %Framenumber
VIIDEOscoreDist = computeVIIDEOscore(vidname,height,width, ...
framenumber,blocksizerow,blocksizecol,...
blockrowoverlap,blockcoloverlap,filtlength);
disp(sprintf('Video quality for distorted video: %f', VIIDEOscoreDist));
% Compute the score for a pristine video
vidname = 'foreman_org_qcif.yuv';
filep = dir(vidname);
fileBytes = filep.bytes; %Filesize
fwidth = 0.5;
fheight = 0.5;
clear filep
framenumber = fileBytes/(width*height*(1+2*fheight*fwidth)); %Framenumber
VIIDEOscorePris = computeVIIDEOscore(vidname,height,width, ...
framenumber,blocksizerow,blocksizecol,...
blockrowoverlap,blockcoloverlap,filtlength);
disp(sprintf('Video quality for pristine video: %f', VIIDEOscorePris)) ;