% Histogram pooling method
% omtp = temppool_hist(om, p)
% om vector of objective metric scores for each frame
% p percentile value
% For metrics whose score risrs as degradation rises (VQM, MSE, sqrtMSE)
% high values of p are in correspondence with poorest quality section of
% the sequence influence on most of viewers' ratings. For PSNR and SSIM low
% values of p suggest the same.
function omtp = temppool_hist(om, p)
    if ~isvector(om)
        error('Input om must be a vector')
    end
    if ~isscalar(p) || p < 0 || 0 > 100
        error('Input p must be a valid percentage');
    end
    omtp = prctile(om, p);