function size = optimalCodingSize(pyramid)
% return the coding size of the pyramid,
% using optimal VL coding in each of the levels separately
% close to 4/3 * #pixels * weighted entropy

[cols, rows, levels] = size(pyramid);

size = 0;

for level = 0:levels-1
   image = getLevel(pyramid, level);
   h = entropy(image);
   size = size + h*cols*rows/4^level;
end


   