function out = clrlinear(file,p)
Q = p* [8 16 24 32 40 48 56 64
16 24 32 40 48 56 64 72
24 32 40 48 56 64 72 80
32 40 48 56 64 72 80 88
40 48 56 64 72 80 88 96
48 56 64 72 80 88 96 104
56 64 72 80 88 96 104 112
64 72 80 88 96 104 112 120]
X = imread(file);
X = double(X);
r = X(:,:,1);
g = X(:,:,2);
b = X(:,:,3);
[m,n] = size(r);
for i = 1:8:m
for j = 1:8:n
block = r(i:i+7,j:j+7);
comp = imagecomp(block,Q);
r(i:i+7,j:j+7) = comp;
end
end
for i = 1:8:m
for j = 1:8:n
block = g(i:i+7,j:j+7);
comp = imagecomp(block,Q);
g(i:i+7,j:j+7) = comp;
end
end
for i = 1:8:m
for j = 1:8:n
block = b(i:i+7,j:j+7);
comp = imagecomp(block,Q);
b(i:i+7,j:j+7) = comp;
end
end
X(:,:,1) = r;
X(:,:,2) = g;
X(:,:,3) = b;
figure
imagesc(uint8(X));
title(['P = ', num2str(p)])
out = X;
Not enough input arguments.
Error in clrlinear (line 7)
Q = p* [8 16 24 32 40 48 56 64 %Linear Quantiziation matrix