BDPSNR的运算多是通过Joel Jung所设计的excel的 宏函数来计算的, 不过Joel Jung并没有提供源代码, 而且有时候excel在使用上并不方便, Serge 用matlab实现了BDPSNR的计算,会比使用excel方便, 下面是源码:
function avg_diff = bjontegaard2(R1,PSNR1,R2,PSNR2,mode) %bjontegaard2 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. % Fixed integration interval in version 2. % % 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) 2