资源简介

BDBR表示在同样的客观质量下,较优的编码方法可以节省的码率百分比,其中BDBR越小,当前编码器的压缩性能越佳;BD-PSNR表示在同等码率下,两种编码条件下压缩后视频PSNR值的差异,其中BD-PSNR值越大,当前编码器质量损失越小。 计算视频质量BDBR 和BD-PSNR的matlab代码,运行正确。

资源截图

代码片段和文件信息

function avg_diff = bjontegaard(R1PSNR1R2PSNR2mode)

%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.
%
%   R1PSNR1 - RD points for curve 1
%   R2PSNR2 - 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 Giuseppe Valenzise
%
%   References:
%
%   [1] G. Bjontegaard Calculation of average PSNR differences between
%       RD-curves (VCEG-M33)
%   [2] S. Pateux J. Jung An excel add-in for computing Bjontegaard metric and
%       its evolution

% convert rates in logarithmic units
lR1 = log(R1);
lR2 = log(R2);

switch lower(mode)
    case ‘dsnr‘
        % PSNR method
        p1 = polyfit(lR1PSNR13);
        p2 = polyfit(lR2PSNR23);

        % integration interval
        min_int = min([lR1; lR2]);
        max_int = max([lR1; lR2]);

        % find integral
        p_int1 = polyint(p1);
        p_int2 = polyint(p2);

        int1 = polyval(p_int1 max_int) - polyval(p_int1 min_int);
        int2 = polyval(p_int2 max_int) - polyval(p_int2 min_int);

        % find avg diff
        avg_diff = (int2-int1)/(max_int-min_int);

    case ‘rate‘
        % rate method
        p1 = polyfit(PSNR1lR13);
        p2 = polyfit(PSNR2lR23);

        % integration interval
        min_int = min([PSNR1; PSNR2]);
        max_int = max([PSNR1; PSNR2]);

        % find integral
        p_int1 = polyint(p1);
        p_int2 = polyint(p2);

        int1 = polyval(p_int1 max_int) - polyval(p_int1 min_int);
        int2 = polyval(p_int2 max_int) - polyval(p_int2 min_int);

        % find avg diff
        avg_exp_diff = (int2-int1)/(max_int-min_int);
        avg_diff = (exp(avg_exp_diff)-1)*100;
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2219  2014-02-12 13:09  bjontegaard\bjontegaard.m

     文件       1318  2014-02-12 13:09  bjontegaard\license.txt

     文件        445  2014-02-12 13:09  bjontegaard\test_bjontegaard.m

     目录          0  2019-01-16 17:58  bjontegaard

----------- ---------  ---------- -----  ----

                 3982                    4


评论

共有 条评论