function rebuiltImage = decompressImage(compImage, ni, nj, C, Q)

rebuiltImage = zeros(ni*8,nj*8);

% Decompression
for i = 1:ni
  for j = 1:nj
    if (i == 1)
        index1 = 1;
    else
        index1 = ((i-1)*8) + 1;
    end
    if (j == 1)
        index2 = 1;
    else
        index2 = ((j-1)*8) + 1;
    end
    chunk = compImage(index1:((i)*8),index2:((j)*8));
    chunk = chunk.*Q;
    chunk = C'*chunk*C;
    chunk = chunk + 128;  % De-Center
    rebuiltImage(index1:((i)*8),index2:((j)*8)) = chunk;
  end
end