PDA

查看完整版本 : [求助]关于算术编码子程序的问题


vanniyu
2008-07-11, 11:07
在算术编码解码过程中的子函数中
function symbos=arithdecode(symbols,ps,codeword,symlen)
format long e;
high_range=[];
for k=1:length(ps)
high_range=[high_range sum(ps(1:k))];
end
low_range=[0 high_range(1:length(ps)-1)];
psmin=min(ps);
symbos=[];
for i=1:symlen
idx=max(find(low_range<=codeword));
codeword=codeword-low_range(idx);
if abs(codeword-ps(idx))<0.01*psmin
idx=idx+1;
codeword=0;
end
symbos=[symbos symbol(idx)];
codeword=codeword/ps(idx);
if abs(codeword)<0.01*psmin
i=symlen+1;
end
end

关于'symbos=[];'的定义,和"symbos=[symbos symbol(idx)];"提示有错误,说symbos[]没有定义的函数,请高手为我指点一下

vanniyu
2008-07-17, 15:38
我会了,什么破论坛,真需要人帮助的时候没有一个能用上的人,资料也不行

1234567fc
2009-08-27, 15:06
就是啊,资料老是错的,浪费我时间