微信:HuangL1121
QQ号:1224848052
团队:MATLAB代做|MATLAB专业代做|FPGA代做|FPGA专业代做
地址:北京市-朝阳区-双柳北街18号院
当前位置:首页 > 技术资讯 > MATLAB代做|图像压缩编码码matlab实现

MATLAB代做|图像压缩编码码matlab实现

function x = DMdecode(y, a) 
%函数DMdecode为解码程序,y为要解码的预测误差矩阵,a为预测系数,当a默认时,a = 1。 
 
error(nargchk(1, 2, nargin)); 
if nargin < 2 
    a = 1; 
end 
 
[m, n] = size(y); 
x = zeros(m, n + 1); 
for j = 1: n 
    jj = j + 1; 
    x(:, jj) = y(:, j) + a.* x(:, (jj-1)); 
end 
x = x(:, 1+1:end);
function arcode = arencode(symbol, pr, seqin) 
%算术编码 
%输出:码串 
%输入:symbol:字符行向量 
%      pr:字符出现概率 
%      seqin:待编码字符串 
 
high_range = []; 
for k = 1: length(pr), 
    high_range = [high_range sum(pr(1: k))]; 
end 
 
low_range = [0 high_range(1: length(pr) - 1)]; 
sbidx = zeros(size(seqin)); 
for i = 1: length(seqin), 
    sbidx(i) = find(symbol == seqin(i)); 
end 
 
low = 0; high = 1; 
for i = 1: length(seqin), 
    range = high - low; 
    high = low + range * high_range(sbidx(i)); 
    low = low + range * low_range(sbidx(i)); 
end 
arcode = low; 

上一篇:FPGA代做-使用Arduino玩转FPGA

版权所有: MATLAB代做|MATLAB专业代做|FPGA代做|FPGA专业代做 Copyright © 2018 All rights reserved.
微信:HuangL1121 QQ:1224848052
地址:北京市-朝阳区-双柳北街18号院

扫一扫,关注我们