costfuncmad.m

来自「本程序的目的是通过变化DCT系数以及寻找可以应用的DCT系数的最小值来进行可扩展」· M 代码 · 共 25 行

M
25
字号
% Computes the Mean Absolute Difference (MAD) for the given two blocks% Input%       currentBlk : The block for which we are finding the MAD%       refBlk : the block w.r.t. which the MAD is being computed%       n : the side of the two square blocks%% Output%       cost : The MAD for the two blocks%% Written by Aroh Barjatyafunction cost = costFuncMAD(currentBlk,refBlk, n)%currentBlk=double(currentBlk);%refBlk=double(refBlk);err = 0;for i = 1:n    for j = 1:n        err = err + abs((currentBlk(i,j) - refBlk(i,j)));    endendcost = err / (n*n);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?