参考VCEG-M33中bitrate和psnr的关系:
SNR = a + b*bit + c*bit2 + d*bit3
bit = a + b*SNR + c*SNR2 + d*SNR3
function avg_diff = bjontegaard(R1,PSNR1,R2,PSNR2,mode)
%BJONTEGAARD Bjontegaard metric calculation
% Bjontegaard's metric allows to compute the average gain in PSNR or the
% average per cent saving in bitrate between two rate-distortion
% curves [1].
% Differently from the avsnr software package or VCEG Excel [2] plugin this
% tool enables Bjontegaard's metric computation also with more than 4 RD
% points.
%
% R1,PSNR1 - RD points for curve 1
% R2,PSNR2 - RD points for curve 2
% mode -
% 'dsnr' - average PSNR difference
% 'rate' - percentage of bitrate saving between data set 1 and
% data set 2
%
% avg_diff - the calculated Bjontegaard metric ('dsnr' or 'rate')
%
% (c) 2010 Gius